Java SE Embedded How To
Author: Tomas Zezula
Set up Remote Platform
- Create Java/Java Application Project in Files/New Project. Project creation activates the Java Support in the IDE.
- In the Tools/Java Platforms click Add Platform... and select Remote Standard Edition
- In the Set Up Remote Platform panel specify the platform details
- Host the inet address or DNS name of device running ssh where the application should be deployed and executed.
- Username the login on the device
- Password in case of password base authentication the user password on the device.
- Key File and Key Passphrase in case of challenge response authentication the path to private key and passphrase for the private key.
- Remote JRE Path the path to the JRE on the remote device. In case when no JRE is installed on the device the "Crate..." action can be used to create and deploy a new embedded JRE, see Creating & Uploading new Embedded JRE
- Working Dir the working directory on device the IDE will use to deploy the application(s).
- Press Finish. The Finish validates the remote JRE by executing a probe and downloads the remote JRE system properties.
- A new Remote Platform appears in the Java Platform Properties
Set up Java Project to use Remote Platform
- In case of compact1, compact2, compact3 runtime platform the project requires JDK 8.To set the JDK 8 as a project platform go to File/Project Properties/Libraries. If the JDK 8 platform is not yet defined in the IDE click Manage Platforms... and add a new Java Standard Edition platform by pointing the file chooser to JDK 8 home directory.
- In the File/Project Properties/Sources select JDK 8 and required profile, eg. Compact 2.
- In the File/Project Properties/Run change a Runtime Platform from Project Platform to created remote platform. A new project configuration with remote execution is created.
Using Remote Platform
- When a project configuration is set to newly created configuration the project Run and Debug actions are performed on the remote device.
- The change to local execution can be easily done by switching the project configuration to <default config>
Creating & Uploading new Embedded JRE
The new Remote J2SE Platform support jrecreate to build and upload an embedded JRE to the device.
- In the Set Up Remote Platform panel click Create... button.
- Fill the Create Java SE Embedded JRE
- EJDK Location path to the ejdk on the local disk
- Remote JRE Path path where the newly created embedded JRE will be uploaded on remote device.
- Set Embedded JRE options (compact profiles, VM type, etc.)