Difference between revisions of "Setting up Eclipse"

From iDempiere en
(Updated Eclipse setup for iDempiere 8.2)
Tag: visualeditor
(add eclipse notes for master branch (8.2z))
Tag: visualeditor-switched
Line 64: Line 64:
 
* In case there are files with compilation errors you can right click on the iDempiere project and select Maven > Update Projects, then press OK
 
* In case there are files with compilation errors you can right click on the iDempiere project and select Maven > Update Projects, then press OK
  
 +
== Eclipse version for Master Branch (8.2z) ==
 +
* Eclipse 2021-03 and above.
 +
* Eclipse IDE for Enterprise Java and Web Developers.
 +
* Target platform for master branch require "m2e PDE - Maven Integration for Eclipse Plugin Development". This is usually install as part of "Eclipse IDE for Enterprise Java and Web Developers" but not "Eclipse IDE for Java Developers". If your Eclipse installation is missing the "m2e PDE - Maven Integration for Eclipse Plugin Development" component (check at Help > About Eclipse IDE > Installation Details > Installed Software tab), you have to install it from https://download.eclipse.org/releases/latest (Help > Install New Software...). This plugin sit inside the "General Purpose Tools" category.
  
 
''This tutorial is brought to you by [[User:CarlosRuiz|Carlos Ruiz]] from [https://www.bx-service.com/ BX Service GmbH].  Feel free to improve directly or suggest using the Discussion tab.
 
''This tutorial is brought to you by [[User:CarlosRuiz|Carlos Ruiz]] from [https://www.bx-service.com/ BX Service GmbH].  Feel free to improve directly or suggest using the Discussion tab.

Revision as of 07:15, 11 June 2021

⇐ Table of Contents | Download the Code | Setting up Eclipse | Importing DB Seed Manually ⇒

Materialize and build

On the operating system navigate to the folder where you cloned the code, named below as $IDEMPIERE_REPOSITORY (f.e. /home/carlos/sources/idempiere), and run the next command:

cd $HOME/sources/idempiere
mvn verify

This command download all libraries on Bundle-ClassPath, build all projects and output binaries to org.idempiere.p2/target/products. If not, verify with mvn -version that maven is using the correct java-version.

Setup workspace in Eclipse

  • Open again the eclipse you configured with the workspace pointing to the folder where you cloned the code
    • Following the example here this folder would be $HOME/sources/idempiere
  • Turn off Project > Build automatically
  • Navigate to Window > Preferences > General > Workspace
    • set "Text file encoding" to "UTF-8" (if default is different)
    • set "New text file line delimiter" to "Unix" (if default is different)
  • Navigate to Window > Preferences > Java > Compiler
    • set Java > Compiler > Compiler compliance level to "11"
  • in Java > Installed JREs add the java-11-openjdk JRE if not present and select it as the active JRE:
    • click the Add button, then
    • select Standard VM, click next
    • enter "/usr/lib/jvm/java-11-openjdk-amd64" as JRE Home, click finish
    • click the Checkbox next to the new entry to apply the changes.
  • Not required, is a personal preference, but normally I switch here to Java perspective and choose to Working Sets as the Top Level Elements

Import projects in Eclipse

  • Navigate to File > Import
  • Navigate to Maven > Existing Maven Projects
  • Click Next button and Browse to $IDEMPIERE_REPOSITORY (must appear there by default)
    • Following the example here this folder would be $HOME/sources/idempiere
  • All projects must appear selected, click Finish to complete the import
    • At the end all projects are loaded into workspace
  • Sometimes eclipse creates changes to the workspace, you can discard those changes at this point via right click on the projects and choosing Replace With > HEAD Revision

(just for 8.2) Import target platform

These steps are required if you work on 8.2, but not required with the current master branch (a.k.a. 8.2.z)

  • Still in eclipse
  • Navigate to File > Import
  • Navigate to General > Existing Projects into Workspace
  • Click Next button and Browse to $IDEMPIERE_REPOSITORY/org.idempiere.p2.targetplatform
  • Click Finish to complete the import

Set target platform

  • Now open the file org.idempiere.p2.targetplatform.target within the project org.idempiere.p2.targetplatform
    • This is the default target platform definition with remote url
    • Here eclipse takes some time downloading the required dependencies, you can prepare some Colombian coffee and wait patiently :)
  • At Target Editor, click the "Set as Active Target Platform" link
  • Wait for Eclipse to finish downloading bundles onto target platform
    • Click the "Reload" button if some download fail, until there are not red errors on the Locations list
  • At the end you can enabled back Project > Build automatically
  • In case there are files with compilation errors you can right click on the iDempiere project and select Maven > Update Projects, then press OK

Eclipse version for Master Branch (8.2z)

  • Eclipse 2021-03 and above.
  • Eclipse IDE for Enterprise Java and Web Developers.
  • Target platform for master branch require "m2e PDE - Maven Integration for Eclipse Plugin Development". This is usually install as part of "Eclipse IDE for Enterprise Java and Web Developers" but not "Eclipse IDE for Java Developers". If your Eclipse installation is missing the "m2e PDE - Maven Integration for Eclipse Plugin Development" component (check at Help > About Eclipse IDE > Installation Details > Installed Software tab), you have to install it from https://download.eclipse.org/releases/latest (Help > Install New Software...). This plugin sit inside the "General Purpose Tools" category.

This tutorial is brought to you by Carlos Ruiz from BX Service GmbH. Feel free to improve directly or suggest using the Discussion tab.

⇐ Table of Contents | Download the Code | Setting up Eclipse | Importing DB Seed Manually ⇒

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