I am having a hard time trying to build my javafx app into .app (for mac). I found a legit way to do that, here is resource for that: http://docs.oracle.com/javafx/2/deployment/deploy_quick_start.htm However, it is far from what I'm looking for. By following that tutorial, I managed to build an app from my javafx project, however the size of file was just ridiculous and it is because the whole JRE is being bundled inside. I am now looking for a way to deploy .app file with dependencies (it's important) ONLY and without JRE. (JRE should be pre-installed by user). Is there a way to do that? I really tried to find one, but faild. Hope you, guys, help me.
1 Answers
Instructions for packaging a JavaFX application as a native installable app without including a JRE:
JavaFX packaging tools update - Self-Contained Applications: Create Package without Java Runtime.
The tools used are the same as from the deployment quick start you mention in your question. You just set the fx:platform basedir=""
.
I'll just quote the article here:
This may sound a bit puzzling at first glance. Package without embedded Java Runtime is not really self-contained and obviously will not help with:
- Deployment on fresh systems. JRE need to be installed separately (and this step will require admin permissions).
- Possible compatibility issues due to updates of system runtime.
However, these packages are much much smaller in size. If download size matters and you are confident that user have recommended system JRE installed then this may be good option to consider if you want to improve user experience for install and launch.
Technically, this is implemented as an extension of previous feature. Pass empty string as value for 'basedir' attribute and this will be treated as request to not bundle Java runtime, e.g.
<fx:platform basedir=""/>
-
This looks like a right solution. However, for some reason it does not work. Neatbeans throws an error: fx:platform doesn't support the "basedir" attribute. I have the latest JDK. Any ideas? – ksarunas Apr 30 '13 at 17:58
-
NetBeans does not support all features of the JavaFX deployment tools. Try it outside of NetBeans, by directly running an ant based JavaFX deployment task from the command line. – jewelsea Apr 30 '13 at 18:01
-
I haven't tried this solution myself. I'll try it later on my OS X box at home when I have some time. – jewelsea Apr 30 '13 at 18:01
-
Ok, I am accepting you answer, although I still need to look into this. But you helped me a lot, thanks. – ksarunas Apr 30 '13 at 18:28