Version 68 (modified by 10 years ago) ( diff ) | ,
---|
Setting up Eclipse IDE
1. Download and install Java Development Kit (JDK)
Windows
- 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
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
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
In order for Subversion to work properly, this is required:
sudo apt-get install subversion libsvn-java
2. Download and setup Eclipse
- 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.
- Best to download a ZIP version and just unpack it in folder of your choice
Ubuntu - before running Eclipse
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.
Run Eclipse
3. Install the m2eclipse and subclipse plugins
Install the m2eclipse plugin from the following update address - http://m2eclipse.sonatype.org/sites/m2e (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)
Note: New version of Eclipse Java and Java EE include a Maven plugin, so it is not necessary to install it.
In the same way, install the Subclipse plugin from the following update address - http://subclipse.tigris.org/update_1.6.x
4. Download the project 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.
Before running or building the project, several local parameters should be set. This is done via a standard way of maven profiles, so you should open/create a file named settings.xml in the .m2 directory in your main OS user profile 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.url> <jdbc.default_schema>????????</jdbc.default_schema> <jdbc.username>??????????</jdbc.username> <jdbc.password>??????????</jdbc.password> <hib.hbm2ddlauto>??????????</hib.hbm2ddlauto> <cas.server>??????????</cas.server> <app.server>??????????</app.server> <ldap.addomain>??????????</ldap.addomain> <ldap.baseUserDN>??????????</ldap.baseUserDN> <ldap.bindPassword>??????????</ldap.bindPassword> <ldap.bindUserDN>??????????</ldap.bindUserDN> <ldap.protocol>??????????</ldap.protocol> <ldap.url>??????????</ldap.url> </properties> </profile> </profiles> <activeProfiles /> </settings>
You can create several profiles in this file, with different id and activation parameters, so that you can use choose the one you want on running the application, or packaging for deployment.
Contact the developer team for parameter values for the development test servers. Otherwise install PostgreSQL, setup a username, password and create a UTF-8 database, and set the hbm2ddlauto parameter to update, and the database schema structure will be automatically created.
With hbm2ddlauto=update used, enables updates to the database schema structure when the Java source code of the Entities changes, otherwise 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 dossier), 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
Click on Run and the application will begin to build.
Note that on the first run, Maven will try to download all required libraries for development from the Internet and setup the library paths for all dependencies. This can take a very long time if your connection is not fast. On subsequent runs, this will not happed, but Maven tries to check for changes. If you want to speed up the process, after everything has been run without problems at least once, you should check the parameter Offline in the Maven parameters for that run configuration.
The system listens on port 8081 (Jetty on 8081) http://localhost:8081/
Note:
- in log4j.properties in the application folder src/main/resources one should change the line
log4j.appender.R.File=/upisi.log or log4j.appender.R.File=/home/username/upisi.log or a location where the user running eclipse has write permission and where the logs should reside.
Attachments (5)
- 1.jpg (58.0 KB ) - added by 15 years ago.
- 2.jpg (57.9 KB ) - added by 15 years ago.
- 10.jpg (89.8 KB ) - added by 15 years ago.
- isis_project_in_eclipse.png (13.3 KB ) - added by 10 years ago.
- eclipse_ide_choose_jdk.png (44.3 KB ) - added by 10 years ago.
Download all attachments as: .zip