wiki:DeveloperInstructions

Version 65 (modified by Vangel Ajanovski, 13 years ago) ( diff )

Setting up Eclipse IDE

Download and install Java Development Kit (JDK)

  • Set up system variable JAVA_HOME to the absolute path to the main directory of the JDK installation
  • Set up system variable PATH to the absolute path of the bin directory inside the JDK
  • For 64-bit operating systems, both 64-bit and 32-bit JDK versions should be installed

  • Check installation in command shell
    javac -version
    

you should get the installad java compiler version


( Ubuntu 10.04 ) installation of Java, Eclipse and plugins from package repositories.

  1. Enable the Partner repository in order to install Sun Java.
    sudo add-apt-repository "deb http://archive.canonical.com/ubuntu lucid partner"
    

then install the software

sudo apt-get update && sudo apt-get install sun-java6-jdk sun-java6-plugin sun-java6-jre

1.1. If another version of Java has been installed previously, this command will make the latest Sun Java installation as default.

sudo update-java-alternatives -s java-6-sun 
  1. Add the repository for Eclipse and Subclipse
    sudo add-apt-repository ppa:yogarine/eclipse
    

then install them

sudo apt-get update && sudo apt-get install eclipse-wtp eclipse-subclipse

2.1 In order for Subversion to work properly, this is required:

sudo apt-get install subversion libsvn-java

open the eclipse.ini in a text editor with administrative privileges:

sudo nano /usr/lib/eclipse/eclipse.ini

and add this as a last line (do not modify the rest):

-Djava.library.path=/usr/lib/jni

then Eclipse will start without problems.

  1. Install the m2eclipse plugin (explained below).

Download Eclipse and install the Plugins

  • Download Eclipse (for Java Developers is enough as a basic installation, but Eclipse Java EE is recommended because the packages for Web Development (WTP) are preinstalled.

(In Eclipse → Help → Install New Software , you will add the address and available packages will showup, please add everything becides AJDT and WTP that depend on other plugins)

Download the source code and setup a project

Change the Eclipse IDE perspective to SVN Repository and create a new project with the option Checkout as maven project, from the address http://develop.ii.edu.mk/svn/isii Maven is supposed to download all necessary files needed to run the application that are listed in the pom.xml (this might actually take very very long depending on the internet connection speed ).
Note:If you use Ubuntu, when you choose a plugin, by marking it at the relevant check box, the Next button of the wizard might stay disabled. If this happens, just press ENTER (with the plugin installation window in focus).

Eclipse setup

  • In Eclipse open Window → Preferences → Java → Installed JREs

Delete the old record and add a new one that points to the JDK (and not JRE) as in the image

  • After this create a Shortcut to Eclipse.exe anywhere you like, right click the shortcut, and in the Target textbox add:

-vm "C:\Program Files (x86)\Java\jdk1.6.0_16\bin" This is supposed to be the path to the JDK/bin folder. (on 64-bit operating systems the path in the –VM argument should point to a 32-bit JDK)

With these two steps Eclipse will start and won't show a maven related warning. For a linux installation everything is the same just a different path.

The parameters for the database connection and authentication server are configured throught a profile in the user settings.xml file in the .m2 Maven user directory.

Sample maven settings.xml file:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository />
    <interactiveMode />
    <usePluginRegistry />
    <offline />
    <pluginGroups />
    <servers />
    <mirrors />
    <proxies />
    <profiles>
        <profile>
            <id>develop</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>develop</value>
                </property>
            </activation>
            <properties>
                <jdbc.url>jdbc:postgresql://localhost:9999/именабазата</jdbc.url>
                <jdbc.default_schema>databaseSchema</jdbc.default_schema>
                <jdbc.username>username</jdbc.username>
                <jdbc.password>password</jdbc.password>
                <hib.hbm2ddlauto>validate</hib.hbm2ddlauto>
                <cas.server>http://localhost:8081</cas.server>
                <app.server>http://localhost:8081</app.server>
            </properties>
        </profile>
    </profiles>
    <activeProfiles />
</settings>

Contact the developer team for connection details of the test development server and how to connect to it. Otherwise install PostgreSQL, setup a username, password and create a UTF-8 database, and set the hbm2ddl.auto parameter to update, and the database schema structure will be automatically created.

hbm2ddl.auto=update is used to enable updates in to the database schema structure when the Java source code of the Entities changes, the default value of this parameter is validate.

More precisely this parameter designates that the database will be scanned and if the source code has structural changes, such changes will be automatically implemented in the database schema. This should be only used by intenet and it should not be left as default as unwanted changes could be commited to the database by mistake without a warning. So set this to update only when you are about to make database structure changes and then change it back to validate, which only checks that the source and the schema correspond.

If you use another database system then hibernate.dialect should be changed, *but this is not tested*.

CAS

If you already have a CAS server, change the paths in the settings.xml file. If you need a test CAS server, follow the procedure.

  • Download CAS (CENTRAL AUTHENTICATION SERVICE) from http://www.ja-sig.org/products/cas/ and unpack it.
  • Find the file named CAS-server-webapp-versionnumber.war and copy it to the main folder of the Eclipse project and rename it to cas.war

This will enable a test login to the system, whereas the username is anything you need, and the password is the same as the username.

Start the application from Eclipse

Run → Run Configurations , then in the maven section right click then New, use any Name you like (for example “start app”), Base Directory → ${workspace_loc:/projectname} , Goals → clean jetty:run In the parameter add one with the name of *env*, and value of *develop*.

Repeat this again all the same but with a Name "stop app" and Goals "jetty:stop"

It should look like this:

Click on Run and the application will start (some packages will be downloaded from the Internet for the first run).

On subsequent runs, you can speed up the process if you check the parameter Offline in the Maven setting for that run goal.

The system listens on port 8081 (Jetty on 8081)

Note:

  • in log4j.properties in the application folder src/main/resources one should change the line

log4j.appender.R.File=/upisi.log во log4j.appender.R.File=/home/username/upisi.log to a location where the user running eclipse has write permission and where the logs should reside.

WikiStart Back

Attachments (5)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.