Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "BaSyx / Download / Java Setup"
(Removes obsolete steps for setting up Eclipse) |
m (Updates content to reflect the most recent build) |
||
Line 19: | Line 19: | ||
Now select (at least) the following Projects and click "Finish". | Now select (at least) the following Projects and click "Finish". | ||
− | * | + | * basyx.sdk |
− | * | + | * basyx.components |
− | * | + | * basyx.examples |
+ | |||
[[File:Project-selection.png|500px]] | [[File:Project-selection.png|500px]] | ||
− | Now | + | Now all of them will be imported to the Eclipse IDE as maven projects. |
− | + | ||
=== Starting development === | === Starting development === | ||
Line 32: | Line 32: | ||
# Make sure that each project has a JDK selected as JRE System Library | # Make sure that each project has a JDK selected as JRE System Library | ||
− | # Right-click | + | # Right-click “basyx.sdk” >> Select “Run As” >> Select “Maven Install” |
− | + | Maven will download all required sources, run the unit and integration tests and install the projects into the local maven repository. | |
+ | Note: If the JRE System Library is not set up in Eclipse, the following error will occur: | ||
+ | ''No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?'' | ||
+ | * Preferences >> Java >> Installed JREs >> Enable the JDK | ||
+ | * >> Execution Environments >> JavaSE-1.8 >> Enable the JDK | ||
− | |||
The mentioned projects are depending on each other as shown below: | The mentioned projects are depending on each other as shown below: | ||
Line 41: | Line 44: | ||
[[File:BaSyx_Java_Dependencies.PNG]] | [[File:BaSyx_Java_Dependencies.PNG]] | ||
− | + | This means basyx.components depends on basyx.sdk and basyx.examples depends on both of the two other projects. So if you make changes in e.g. basyx.sdk, you need to "install" it with maven. This reflects these changes in the other projects. | |
− | Before you get started, the second task you need to do is to update the .sdk project to align with the maven configuration. For this what you need to do is | + | Before you get started, the second task you need to do is to update the basyx.sdk project to align with the maven configuration. For this what you need to do is |
− | * Right-click | + | * Right-click “basyx.sdk” >> Select “Maven” >> Select “Update Project…” (ignore errors) |
Finally, the last step is to run a Maven clean compile to make sure that the changes you do during coding are directly reflected when you execute single unit tests manually. | Finally, the last step is to run a Maven clean compile to make sure that the changes you do during coding are directly reflected when you execute single unit tests manually. | ||
− | * Right-click | + | * Right-click “basyx.sdk” >> Select “Run As” >> Select “Build…”, type “clean test-compile” in the "Goals" field and click "Run". |
− | '' | + | '' Note: If changes do not reflect in manual unit testing, make sure to clean compile after each install!'' |
− | + | ||
To make basyx.examples compile, you need to do a Maven install of basys.components first. This, in turn, requires to set up and run your postgreSQL installation as [[BaSyx:BaSyx.Documentation.Component.Build | described here]]. | To make basyx.examples compile, you need to do a Maven install of basys.components first. This, in turn, requires to set up and run your postgreSQL installation as [[BaSyx:BaSyx.Documentation.Component.Build | described here]]. |
Revision as of 12:15, 28 February 2020
Contents
How to build the BaSyx Java SDK
The BaSyx Java SDK is using maven to generate and control its building process. This article will detail on how to build the Java SDK from a fresh checkout.
Requirements
The BaSyx Java SDK requires the following dependencies to successfully build:
- Java™ SE Development Kit 8, Update 152 (JDK 8u152 or higher)
- Maven
To check out BaSyx, you also need a GIT installation. No Eclipse GIT plugin is required as we can do the checkout by using GIT only from the command line. If you want to checkout using Eclipse, you need the EGit plugin and also the Maven SCM Handler for EGit (more on that below).
Getting started
Check out BaSyx from the command line with
git clone https://git.eclipse.org/r/basyx/basyx
into some directory of your choice. Now start Eclipse, open File -> Import, choose Maven -> Existing Maven Projects, and click "Next". Now click "Browse", and navigate to the directory where BaSyx was checked out to.
Now select (at least) the following Projects and click "Finish".
- basyx.sdk
- basyx.components
- basyx.examples
Now all of them will be imported to the Eclipse IDE as maven projects.
Starting development
In order to start developing on the project, the first thing you need to do is
- Make sure that each project has a JDK selected as JRE System Library
- Right-click “basyx.sdk” >> Select “Run As” >> Select “Maven Install”
Maven will download all required sources, run the unit and integration tests and install the projects into the local maven repository. Note: If the JRE System Library is not set up in Eclipse, the following error will occur: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
- Preferences >> Java >> Installed JREs >> Enable the JDK
- >> Execution Environments >> JavaSE-1.8 >> Enable the JDK
The mentioned projects are depending on each other as shown below:
This means basyx.components depends on basyx.sdk and basyx.examples depends on both of the two other projects. So if you make changes in e.g. basyx.sdk, you need to "install" it with maven. This reflects these changes in the other projects.
Before you get started, the second task you need to do is to update the basyx.sdk project to align with the maven configuration. For this what you need to do is
- Right-click “basyx.sdk” >> Select “Maven” >> Select “Update Project…” (ignore errors)
Finally, the last step is to run a Maven clean compile to make sure that the changes you do during coding are directly reflected when you execute single unit tests manually.
- Right-click “basyx.sdk” >> Select “Run As” >> Select “Build…”, type “clean test-compile” in the "Goals" field and click "Run".
Note: If changes do not reflect in manual unit testing, make sure to clean compile after each install!
To make basyx.examples compile, you need to do a Maven install of basys.components first. This, in turn, requires to set up and run your postgreSQL installation as described here.