Difference between revisions of "Installation in Eclipse"

From iDempiere en
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
<span style="color:red">'''This page can contain obsolete information, please refer to [[Installing iDempiere]]'''</span>
 +
 +
 
To develop with source code you have to install the source tree in an Eclipse environment.
 
To develop with source code you have to install the source tree in an Eclipse environment.
 +
 +
Installing iDempiere from the source up to a running system is a complex and error-prone process. I urgently recommend to first get some experience by [[Installation on Debian|installing it from an installation package]] and getting used to things like Java version, PostgreSQL configuration, etc.
 +
 +
:''If there are any issues in your installation process you may have a look at the "official" installation pages at http://www.globalqss.com/wiki/index.php/IDempiere. These pages are written by Carlos Ruiz and contain the first full-usable installation documentation. They are some years old and work with older versions but they still contain great wisdom.''
 +
 +
  
 
= Prerequisities =
 
= Prerequisities =
  
−
==OS==
+
== OS ==
−
 
 
:'''Linux''', MS Windows or MacOS
 
:'''Linux''', MS Windows or MacOS
  
−
==JDK==
+
Most developers work with [http://www.debian.org Debian Linux] or Ubuntu Linux.
−
:'''Java6''' is recommended. You can use Java6 from Sun or OpenJDK6. (iDempiere runs with Java7 also but will throw some warnings.)
 
  
−
==Database==
+
== Java JDK ==
 +
:'''Java 6''' is recommended. You can use Java6 from Sun or OpenJDK (recommended). (iDempiere runs with Java7 also but will throw some warnings.)
 +
 
 +
  aptitude install openjdk-7-jdk openjdk-7-source openjdk-7-doc
 +
 
 +
== Database ==
 
:'''PostgreSQL 9.1''' or higher (iDempiere does still work with 8.4 but there are some special issues)
 
:'''PostgreSQL 9.1''' or higher (iDempiere does still work with 8.4 but there are some special issues)
  
−
==Source Management Tool==
+
  aptitude install postgresql postgresql-contrib
 +
 
 +
In the standard Debian installation of PostgreSQL there is no administrator access with a password and no access through TCP/IP. You have to configure that. This is not the scope of this document. If you have questions here I urgently recommend to first [[Installation on Debian|install iDempiere from an installation package]] and get some experience there.
 +
 
 +
== Revision Control ==
 
:'''Mercurial''' Client (hg commandline)
 
:'''Mercurial''' Client (hg commandline)
 +
 +
  aptitude install mercurial
  
 
==[http://www.eclipse.org Eclipse]==  
 
==[http://www.eclipse.org Eclipse]==  
  
−
:Suggest using Eclipse Indigo 3.7.2.  
+
Older versions of iDempiere suggested to use Eclipse Indige 3.7.2. Nowadays it is tested to use actual versions up to '''Eclipse 4.4 Luna''' (and no reason not to use higher versions in future). If you have problems with this installation and ask for help [https://groups.google.com/forum/#!forum/idempiere in the forum] or in IRC you should know (and tell) which version you installed.
−
* It is safest and easiest to perform iDempiere development in Eclipse Indigo (Version 3.7). Most of problems always are related to using a different version than described in prerequisites.
 
−
* Also some one reported newer versions also working: Eclipse Juno 4.2 by TBayen, Eclipse Kepler SP2 (4.3) by Banym. If you are going to use the versions other than 3.7, you do it for your own risk.
 
−
* Download the correct version here [http://www.eclipse.org/downloads/] (Look on the right hand side for the correct version other than the latest)
 
  
 
===Eclipse Plugin: Eclipse Mercurial===
 
===Eclipse Plugin: Eclipse Mercurial===
  
−
* Menu in Eclipse: Help > Install New Software > Add
+
You should install the [https://bitbucket.org/mercurialeclipse/main/wiki/Home EclipseMercurial Plugin]. There is [http://mercurial.selenic.com/wiki/MercurialEclipse another good introduction] about it. You can install it both from the '''Eclipse Marketplace''' (the new way; in the Help menu) or enter a '''new update site''' and choose the package "Mercurial Eclipse" (nothing else) (the longer established way).
−
* Update Site: http://cbes.javaforge.com/update
+
 
−
* Choose package "Mercurial Eclipse" (nothing else is needed)
+
  http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable
  
 
===Eclipse Plugin: Buckminster===
 
===Eclipse Plugin: Buckminster===
  
−
* Menu in Eclipse: Help > Install New Software > Add
+
You need the [http://eclipse.org/buckminster/ Buckminster] Plugin to assemble the iDempiere project. You have to enter the appropriate update site in the Eclipse "Software Update" window (Menu in Eclipse: Help > Install New Software > Add). The link to the update site can be found at the [http://www.eclipse.org/buckminster/downloads.html Buckminster download page]. It depends on the Eclipse version you are using (see [https://wiki.eclipse.org/Older_Versions_Of_Eclipse here] to see which Eclipse Name belongs to which version number). For Eclipse 4.4 Luna the Update site is:
−
* Update Site:
 
−
** For Eclipse Indigo: using 3.7.  Update site: http://download.eclipse.org/tools/buckminster/updates-3.7
 
−
** For Eclipse Juno: using 4.2. Update site: http://download.eclipse.org/tools/buckminster/updates-4.2
 
−
** For Eclipse Kepler: using 4.3.  Update site: http://download.eclipse.org/tools/buckminster/updates-4.3
 
−
* Choose following packages, the rest are not required:
 
−
** Buckminster - Core
 
−
** Buckminster - Maven support
 
−
** Buckminster - PDE support
 
  
 +
  http://download.eclipse.org/tools/buckminster/updates-4.4
  
−
You may see at the older prerequisities page at http://www.globalqss.com/wiki/index.php/IDempiere/Install_Prerequisites_on_Ubuntu
+
If you install Buckminster on a later version of Eclipse, you must use a specially modified version of Buckminster 4.5. Do '''not''' use the standard Buckminster plugin. For Eclipse 4.6 Neon the Update site is:
  
−
=Download iDempiere source tree=
+
  https://sourceforge.net/projects/idempiere/files/binary.file/jarfile/bm-p2/bucky-updates-4.5
 +
 
 +
Choose following packages, the rest are not required:
 +
* Buckminster - Core
 +
* Buckminster - Maven support
 +
* Buckminster - PDE support
 +
 
 +
= Download iDempiere source tree =
  
 
Choose a trunk repository you trust (e.g. the following) and clone it:
 
Choose a trunk repository you trust (e.g. the following) and clone it:
Line 50: Line 65:
 
   hg clone https://bitbucket.org/idempiere/idempiere idempiere
 
   hg clone https://bitbucket.org/idempiere/idempiere idempiere
  
−
==Download Tips==
+
If you have problems have a look at our [[Download Tips]].
−
If you got low speed or failed when connect to https://bitbucket.org (This happens often in China), here are the steps to follow:
 
  
−
* Step 1: Download the packed source code from [https://sourceforge.net/projects/idempiere/ https://sourceforge.net/projects/idempiere] . For example, the latest one is [http://sourceforge.net/projects/idempiere/files/v2.0/source-repo/ idempiere_hgrepo_v2.0.zip]
 
−
* Step 2: Extract the file to your folder, example:
 
−
  $ unzip -d /app/idempiere idempiere_hgrepo_v2.0.zip
 
−
* Step 3: pull changes from the specified source
 
  
−
  $ cd /app/idempiere // Replace with your folder ...
+
= Setting up Eclipse Workspace =
−
  $ hg pull -u
 
−
 
 
−
* Now, you get the codes up to date.
 
  
−
= Setting up Eclipse Workspace =
+
Navigate to "File > Switch Workspace > Other" and choose the previously cloned directory as a workspace.
  
−
There are two excellent resources explaining graphically what is required to setup Eclipse:
+
You get an empty workspace and can use the following way to make Eclipse aware of the iDempiere projects:
−
* From Heng Sin Low (the originator of OSGi Adempiere movement): http://kenai.com/projects/hengsin/pages/Building
 
−
* From Dominik Zajac: http://www.banym.de/eclipse/build-the-idempiere-project-using-eclipse-with-buckminster
 
  
 +
: File -> Import... -> General -> Existing Projects into Workspace -> Next -> "Browse" to the workspace repository -> Finish
  
−
* Navigate to "File > Switch Workspace > Other" and choose the previously cloned directory as a workspace.
+
: If you are in trouble there are some excellent resources about setting up Eclipse [http://kenai.com/projects/hengsin/pages/Building From Heng Sin Low] (the originator of OSGi ADempiere), [http://www.banym.de/eclipse/build-the-idempiere-project-using-eclipse-with-buckminster From Dominik Zajac] and [http://www.globalqss.com/wiki/index.php/IDempiere/Setting_up_Eclipse From Carlos Ruiz].
  
  
Line 78: Line 84:
  
 
* Navigate to File > Import > Buckminster > Materialize from Buckminster MSPEC, CQUERY or BOM
 
* Navigate to File > Import > Buckminster > Materialize from Buckminster MSPEC, CQUERY or BOM
−
* Push the "Next" button and fill the "Enter a URL ..." box with the folder $IDEMPIERE_REPOSITORY/org.adempiere.sdk-feature/adempiere.mspec
+
* Push the "Next" button and fill the "Enter a URL ..." box (using the "Browse" button) with ".../org.adempiere.sdk-feature/adempiere.mspec"
−
:: (You must replace the $IDEMPIERE_REPOSITORY with the corresponding folder name or even better you can use the "Browse" button to navigate there and select the adempiere.cquery file)
 
 
* Here eclipse takes some time to review dependencies and after that you can push the "Finish" button
 
* Here eclipse takes some time to review dependencies and after that you can push the "Finish" button
  
−
Now is a good time to brew some coffee (better [http://www.youtube.com/watch?v=1hWJvBqhbJU Colombian coffee]) - Eclipse will download and configure the whole project and this can be time consuming.
+
Now is a good time to brew some coffee (better [https://www.youtube.com/watch?v=VT5qrngSWhA Colombian coffee]) - Eclipse will download and configure the whole project and this can be time consuming.
 +
 
 +
== Rebuild ==
 +
After materializing you should first refresh all your projects (mark all projects and use the context menu). Then use "Project -> Clean..." and rebuild all projects. This takes a while and should clear away all error messages. Then I close the "doc" project to get rid of the last error message - it has some unresolved dependencies and is not used for compiling. If you use Java7 you have some hundred warning messages (but they are no real problems), if using Java6 there should be not many of these messages left.
  
 
''When this step finishes it is recommended to close eclipse and take a backup of the $IDEMPIERE_REPOSITORY folder, in case something mess later you can restore the backup and you won't need to download again the whole thing from internet.''
 
''When this step finishes it is recommended to close eclipse and take a backup of the $IDEMPIERE_REPOSITORY folder, in case something mess later you can restore the backup and you won't need to download again the whole thing from internet.''
  
−
(see also http://www.globalqss.com/wiki/index.php/IDempiere/Setting_up_Eclipse)
 
  
−
===NoClassDefFoundError===
+
= Start iDempiere  =
−
"Java.lang.NoClassDefFoundError: org/eclipse/pde/internal/core/target/provisional/ITargetPlatformService"
+
 
 +
Eclipse uses so-called "launch configurations" to start a given piece of code using given plugins and given dependencies with given arguments etc. Some of these launch configurations are already preconfigured in the iDempiere workspace.
 +
 
 +
To start iDempiere try "Run -> Debug Configurations..." and choose what you want to start by selecting one of the launch configurations under "Eclipse Application":
  
−
The error seems to be related to Eclipse Juno.  
+
* '''install.app''' - lets you create an ''idempiere.properties'' file that contains the configuration for the server
 +
* '''server.product''' - starts the zk webserver (needs an ''idempiere.properties'' file).
 +
* '''swingclient.product''' - starts the swing client
  
−
The error will not appear for a previous version of Eclipse Indigo 3.7.
+
In the most developer versions the plugin list (the list of OSGi plugins that are needed to get the whole application running) is not well maintained all the time. You can go to the tab "Plug-Ins" and press the "Validate Plug-Ins" button to check that and press "Add Required Plug-Ins" to add the missing ones.
  
 +
Then you can start the application.
  
−
== rebuild and start ==
 
  
−
You could mark all projects and use the context menu to refresh your eclipse projects. After that you use the menu "Project -> Clean..." to rebuild the whole workspace. After that you should be able to start the iDempiere Code.
+
== Modifying the launch configuration ==
  
−
To start iDempiere try "Run -> Debug Configurations..." and choose the configuration for "Eclipse Application/swingclient.product". You should now be able to start it.
+
Sometimes I want to have different settings to work with different databases (e.g. test and production). To do that I create a copy of the launch configuration "server.product". I rename the copy according to my needs, e.g. "myown-server.product". Then I go to the tab "Arguments" and add the following to the "VM Arguments" (the lower text field):
  
 +
  -DPropertyFile=myown-idempiere.properties
  
−
[[Category:User Manual]]
+
To create this file you can copy your idempiere.properties or you can even make a copied launch configuration of the "install.product".
−
[[Category:Installation]]
 
−
[[Category:Setup]]
 
−
[[Category:Development‏‎]]
 
−
[[Category:Developer documentation‏‎]]
 
  
 +
You can change other things, e.g. you can add your own plugin to the "Plug-Ins" tab etc.
  
 +
[[Category:User Manual|I]]
 +
[[Category:Installation Eclipse]]
  
 
[[en:Installation in Eclipse]]
 
[[en:Installation in Eclipse]]
 
[[zh:在Eclipse安装iDempiere]]
 
[[zh:在Eclipse安装iDempiere]]
 +
[[de:Installation der Entwicklungsumgebung]]

Latest revision as of 06:16, 29 December 2021

This page can contain obsolete information, please refer to Installing iDempiere


To develop with source code you have to install the source tree in an Eclipse environment.

Installing iDempiere from the source up to a running system is a complex and error-prone process. I urgently recommend to first get some experience by installing it from an installation package and getting used to things like Java version, PostgreSQL configuration, etc.

If there are any issues in your installation process you may have a look at the "official" installation pages at http://www.globalqss.com/wiki/index.php/IDempiere. These pages are written by Carlos Ruiz and contain the first full-usable installation documentation. They are some years old and work with older versions but they still contain great wisdom.


Prerequisities

OS

Linux, MS Windows or MacOS

Most developers work with Debian Linux or Ubuntu Linux.

Java JDK

Java 6 is recommended. You can use Java6 from Sun or OpenJDK (recommended). (iDempiere runs with Java7 also but will throw some warnings.)
 aptitude install openjdk-7-jdk openjdk-7-source openjdk-7-doc

Database

PostgreSQL 9.1 or higher (iDempiere does still work with 8.4 but there are some special issues)
 aptitude install postgresql postgresql-contrib

In the standard Debian installation of PostgreSQL there is no administrator access with a password and no access through TCP/IP. You have to configure that. This is not the scope of this document. If you have questions here I urgently recommend to first install iDempiere from an installation package and get some experience there.

Revision Control

Mercurial Client (hg commandline)
 aptitude install mercurial

Eclipse

Older versions of iDempiere suggested to use Eclipse Indige 3.7.2. Nowadays it is tested to use actual versions up to Eclipse 4.4 Luna (and no reason not to use higher versions in future). If you have problems with this installation and ask for help in the forum or in IRC you should know (and tell) which version you installed.

Eclipse Plugin: Eclipse Mercurial

You should install the EclipseMercurial Plugin. There is another good introduction about it. You can install it both from the Eclipse Marketplace (the new way; in the Help menu) or enter a new update site and choose the package "Mercurial Eclipse" (nothing else) (the longer established way).

 http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable

Eclipse Plugin: Buckminster

You need the Buckminster Plugin to assemble the iDempiere project. You have to enter the appropriate update site in the Eclipse "Software Update" window (Menu in Eclipse: Help > Install New Software > Add). The link to the update site can be found at the Buckminster download page. It depends on the Eclipse version you are using (see here to see which Eclipse Name belongs to which version number). For Eclipse 4.4 Luna the Update site is:

 http://download.eclipse.org/tools/buckminster/updates-4.4

If you install Buckminster on a later version of Eclipse, you must use a specially modified version of Buckminster 4.5. Do not use the standard Buckminster plugin. For Eclipse 4.6 Neon the Update site is:

 https://sourceforge.net/projects/idempiere/files/binary.file/jarfile/bm-p2/bucky-updates-4.5

Choose following packages, the rest are not required:

  • Buckminster - Core
  • Buckminster - Maven support
  • Buckminster - PDE support

Download iDempiere source tree

Choose a trunk repository you trust (e.g. the following) and clone it:

 hg clone https://bitbucket.org/idempiere/idempiere idempiere

If you have problems have a look at our Download Tips.


Setting up Eclipse Workspace

Navigate to "File > Switch Workspace > Other" and choose the previously cloned directory as a workspace.

You get an empty workspace and can use the following way to make Eclipse aware of the iDempiere projects:

File -> Import... -> General -> Existing Projects into Workspace -> Next -> "Browse" to the workspace repository -> Finish
If you are in trouble there are some excellent resources about setting up Eclipse From Heng Sin Low (the originator of OSGi ADempiere), From Dominik Zajac and From Carlos Ruiz.


Materializing iDempiere project within Eclipse

Next step is to "materialize" the project. This means that all dependencies are downloaded from the internet.

  • Navigate to File > Import > Buckminster > Materialize from Buckminster MSPEC, CQUERY or BOM
  • Push the "Next" button and fill the "Enter a URL ..." box (using the "Browse" button) with ".../org.adempiere.sdk-feature/adempiere.mspec"
  • Here eclipse takes some time to review dependencies and after that you can push the "Finish" button

Now is a good time to brew some coffee (better Colombian coffee) - Eclipse will download and configure the whole project and this can be time consuming.

Rebuild

After materializing you should first refresh all your projects (mark all projects and use the context menu). Then use "Project -> Clean..." and rebuild all projects. This takes a while and should clear away all error messages. Then I close the "doc" project to get rid of the last error message - it has some unresolved dependencies and is not used for compiling. If you use Java7 you have some hundred warning messages (but they are no real problems), if using Java6 there should be not many of these messages left.

When this step finishes it is recommended to close eclipse and take a backup of the $IDEMPIERE_REPOSITORY folder, in case something mess later you can restore the backup and you won't need to download again the whole thing from internet.


Start iDempiere

Eclipse uses so-called "launch configurations" to start a given piece of code using given plugins and given dependencies with given arguments etc. Some of these launch configurations are already preconfigured in the iDempiere workspace.

To start iDempiere try "Run -> Debug Configurations..." and choose what you want to start by selecting one of the launch configurations under "Eclipse Application":

  • install.app - lets you create an idempiere.properties file that contains the configuration for the server
  • server.product - starts the zk webserver (needs an idempiere.properties file).
  • swingclient.product - starts the swing client

In the most developer versions the plugin list (the list of OSGi plugins that are needed to get the whole application running) is not well maintained all the time. You can go to the tab "Plug-Ins" and press the "Validate Plug-Ins" button to check that and press "Add Required Plug-Ins" to add the missing ones.

Then you can start the application.


Modifying the launch configuration

Sometimes I want to have different settings to work with different databases (e.g. test and production). To do that I create a copy of the launch configuration "server.product". I rename the copy according to my needs, e.g. "myown-server.product". Then I go to the tab "Arguments" and add the following to the "VM Arguments" (the lower text field):

 -DPropertyFile=myown-idempiere.properties

To create this file you can copy your idempiere.properties or you can even make a copied launch configuration of the "install.product".

You can change other things, e.g. you can add your own plugin to the "Plug-Ins" tab etc.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.