How to call an embedded jre from command line in order to run java applications
<p>Is it possible to bundle a JRE within an exported stand alone Java app? We have a very specific requirement to run a standalone AnyLogic Java app on a machine that does not have the latest Java version installed and due to company IT policies we will not be able to do so</p>

<p>Through some research I have found some sites to claim that they have already been doing it for Windows and Mac.</p>

<p><a href="https://stackoverflow.com/questions/11354036/using-a-bundled-jre-on-osx">Using a bundled JRE on OSX</a>
<a href="https://wiki.openjdk.java.net/display/MacOSXPort/How+to+embed+a+.jre+bundle+in+your+Mac+app" rel="nofollow noreferrer">https://wiki.openjdk.java.net/display/MacOSXPort/How+to+embed+a+.jre+bundle+in+your+Mac+app</a>
<a href="http://www.intransitione.com/blog/take-java-to-app-store/" rel="nofollow noreferrer">http://www.intransitione.com/blog/take-java-to-app-store/</a></p>

<p>My issue is that most of these posts refer to bundling an app for Mac OS x and requires that the jar files be created in an IDE like Eclipse. But since I use AnyLogic the jar files gets exported without myself being able to intervene. What I need is to change the command line code that runs the jar files and currently looks like this:</p>

<pre><code>java -Xdock:name="AnyLogic Model" -Dnativewindow.awt.nohidpi=true -cp com.anylogic.engine.jar:com.anylogic.engine.nl.jar:lib/database/querydsl/querydsl-sql-codegen-3.6.3.jar -Xmx256m model6.Simulation $*
</code></pre>

<p>(Note: Code reduced for readability)</p>

<p>into something that I assume will pass the jre or JVM to be used as an argument to the java call. Or maybe set the directory to be used for java or something... as calling the java command on a machine without java installed renders nothing.</p>

<p>I have a very simple app, as well as a jdk plugin that I got from the moneydance app, which is a java app that runs on OSx with its own embedded jre, available here</p>

<p><a href="https://www.dropbox.com/sh/1bedimsb0lj403t/AADYR7iFoBD4YiqS_RGZ2xAVa?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/sh/1bedimsb0lj403t/AADYR7iFoBD4YiqS_RGZ2xAVa?dl=0</a></p>

<p>Thanks</p>