Version 60 (modified by 14 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
( on Ubuntu 9.10 )
If the Sun JDK is installed, please continue to the next step, otherwise
sudo apt-get install sun-java6-jdk
then
sudo gedit /etc/bash.bashrc
At the very end of the file opened in the editor, enter the PATH to where the JDK is installed, for example:
export JAVA_HOME=/usr/lib/jvm/java export PATH=$JAVA_HOME/bin:$PATH
(* please check, your installation could be in some other paths)
As a final check, open another terminal and run:
echo $JAVA_HOME echo $PATH
If you get the path to where Java is installed, then you have set up the paths correctly, and the following command should return the Java version.
javac -version
( on Ubuntu 10.04 ) installation of Java, Eclipse and plugins from package repositories.
- 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
- 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.
- 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.
- 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)
- In the same way, install the Subclipse plugin from the following update address - http://subclipse.tigris.org/update_1.6.x
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.hbm2ddl.auto>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. 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
-D ownload CAS (CENTRAL AUTHENTICATION SERVICE)
http://www.ja-sig.org/products/cas/
Отпакувајте било каде.
Потоа треба да го преснимите CAS-server-webapp-verzija.war во главниот фолдер на апликацијата “upisi”, CAS-server-webapp-verzija.war ќе го најдете каде што отпакувавте во
modules\cas-server-webapp-верзја.war , откако ќе го презнимите WAR фајлот во “upisi” преименувајте го во “cas.war”
Стартување на апликацијата од Eclipse
Во Eclipse :
Run → Run Configurations , потоа на maven десен клик па new , Name > По желба , кај мене е “start app” , Base Directory → ${workspace_loc:/upisi} , Goals → clean jetty:run.[[BR]] Во parameter name ставете env, а во value ставете develop.
Повторете го чекорот уште еднаш само кај Goals → jetty:stop , ставете друго име пример “stop app”
Во parameter name ставете env, а во value ставете develop.
Треба да добите нешто како на сликата
Тоа би било …
The system listens on port 8081 (Jetty on 8081)
Стартувајте со селектирање на апликацијата во Package Explorer и потоа на Run , тоа зеленто копче како Play → па на Run конфигурацијата што ја направивте т.е. “start app” ќе се стартува jetty серверот на порта 8081. За да проверите дали работи апликацијата пробајте да се логирате се со User: ajan Pass:ajan доколку ја користите базата од факултет, најдобро да си креирате свој корисник за тестирање на привилегиите. За локална база треба да знаете дека ви требаат податоци , за правилно логирање. Ако сакате да завршите со тестирање идете на зеленто play па “stop app”
Забелешка:
Само, за тие што користат линукс има некои измени:
- скриптата за тунелирање е: ssh odnadvor@… -L 9999:develop.ii.edu.mk:5432 -N при што побарува лозинка плус (не е внесена како параметар)
- во log4j.properties треба да се смени редот log4j.appender.R.File=/upisi.log во log4j.appender.R.File=/home/"корисничко_име"/upisi.log
(бидејќи немаме пристап до root директориумот)
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