Deploy a JavaFX App with IntelliJ IDEA

4047
2
Jump to solution
02-18-2020 11:12 AM
thomasbales
Occasional Contributor

I am not able to create an artifact using JetBrain's IntelliJ IDEA using java 11.  Below is a link to the problem. Is there a work around? Do I need to go back to Java 8 and 100.4, which would suck because I have queries and futures built into my app.

Package JavaFX applications - Help | IntelliJ IDEA 

Any help would be appreciated. 

Tom

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
thomasbales
Occasional Contributor

Thank you, worked like a charm. I did add a line of code to the launcher and then the jar worked. Thank you.


ArcGISRuntimeEnvironment.setInstallDirectory("Path_To/arcgis-runtime-sdk-java-100.7.0");

View solution in original post

0 Kudos
2 Replies
MarkBaird
Esri Regular Contributor

Tom,

I've looked at the link and have noticed a misleading statement at the top of the page which states:

"Packaging a JavaFX application in a .jar is possible only with Java 8."

This probably only applies to creating the .jar using the IDE UI.  Don't worry your work in Java 11 most certainly CAN be turned into a runnable jar.  Absolutely no need to go back to Java 8 and 100.4 this would be a backwards step.

I would encourage you to look at how we have achieved this in our sample applications where we have used gradle build scripts.  This approach is best as the build scripts can be used inside your CI build process.

The git repository is here: https://github.com/Esri/arcgis-runtime-samples-java

I'd suggest loading up this app directly in IJ https://github.com/Esri/arcgis-runtime-samples-java/tree/master/map/display-map

Using gradle window you can run the app by using application -> run

Once you are happy it works build the jar in gradle window using build-> jar.  The resulting jar file will be in the build/libs folder.

The jar won't work on its own as you will need the native libraries for your chosen platform which is documented here:

https://developers.arcgis.com/java/latest/guide/deploy-your-app.htm

Does this help?

0 Kudos
thomasbales
Occasional Contributor

Thank you, worked like a charm. I did add a line of code to the launcher and then the jar worked. Thank you.


ArcGISRuntimeEnvironment.setInstallDirectory("Path_To/arcgis-runtime-sdk-java-100.7.0");

0 Kudos