Note: the documentation below was Tested with:
- Eclipse IDE 2022-06 (Java and Web developers), OS Linux (Ubuntu 18.04.6 LTS), JRE JavaSE-11.
Building with MAVEN:
-
Download Eclipse, one of the Java developers versions (download Neon 3)). (other versions)
-
Either work with the command line, or download Github Desktop (download).
-
Fork the DSMN github repository to your own account, click on “Clone or Download” (green button), and then on “Open in Desktop”.
-
In the toolbar, click on FILE/Import/Maven/”Existing Maven Projects” and click next.
-
Browse to the folder where your local installation of the repository is saved and select it. All folders and files will be shown in the main field of this page. Deselect the Launcher (in Modules folder).
-
Click on finish.
-
The different folders from the github repository should now appear on the left in your workspace (under package explorer). Normally, errors will show up at this point.
-
Update the project by right click on the project folder, select Maven/”Update Project…” and click OK. If everything went well, all errors should disappear.
-
Select the pom.xml file, and with right click select Run as/ 1. Maven build.
However, if you have never build this project before in Maven with Eclipse, you can also select Run as/”Run Configurations…” and add the following info (such as the Maven goal: “clean install”). Click Apply and Run.
- You should see the output in the Console window (Text: BUILD SUCCESSFUL Total time: 6 seconds). If the build fails, please check our error Q&A below***
Error 1:
*** If the build fails due to the Java version used [Error message: “Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven”] (NOTE: this project needs the Java Developer Kit (JDK), not the Java Runtime Environment (JRE); For more information on why to use JDK iso JRE, see: https://stackoverflow.com/questions/1906445/what-is-the-difference-between-jdk-and-jre )) please take the following steps:
- Go to Window → Preferences, and search for Java. One option is called “Installed JREs”:
-
Click on “Add…” , then “standard VM” and select the local folder where you have a locally installed JDK version of java. Rebuild the workspace (by clicking Apply in the preference menu again.) and try to rebuild DSMN with Maven (step 8 above).
-
If the above doesn’t work, add the JDK-HOME to your classpath (JAVA_HOME). This step is different comparing Windows to Linux (and these steps can differ between versions of Windows or Linux).
-
If you still get JAVA_HOME error messages in Eclipse, set the JAVA_HOME within Eclipse.
-
Update the project by right click on the project folder, select Maven/”Update Project…” and click OK.
- Return to step 9 of the main setup.
Error 2: *** Build failed due to unspecified Java version in pom.xml for Maven compiler
- In the pom.xml file, one can specify the java version which has to be used to build the project.
Change the following lines:
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source/> <target/> </configuration> </plugin>
to:
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>
This allows building the project with Java Open JDK 1.8 .
- Update the project by right click on the project folder, select Maven/”Update Project…” and click OK.
- Return to step 9 of the main setup.
Error 3:
*** If the build fails due to the Maven compiler version please take the following steps:
-
Search which Maven versions are available here . Click on the corresponding name, and in the new window click on the number next to the “latest version” column (which shows all previous version). Update to the version Eclipse mentions in the error message (or a higher version if available). You can make this update in the pom.xml file, under the field called “artifactId”. Current Maven compile version: 3.8.1 .
-
Update the project by right click on the project folder, select Maven/”Update Project…” and click OK.
- Return to step 9 of the main setup.
Error 4:
*** If the build fails due to the dependency version(s) please take the following steps (we will use the Neo4j driver as an example:
- Search which versions are available here, type “org.neo4j.driver . Click on the corresponding name (artifactID column), and in the new window click on the number next to the “latest version” column (which shows all previous version, with this example: (81) ).
Update to the version Eclipse mentions in the error message (or a higher version if available). You can make this update in the pom.xml file, under the field called “version”. Current Neo4j-driver version: 1.7.5 .
- Update the project by right click on the project folder, select Maven/”Update Project…” and click OK.
- Return to step 9 of the main setup.