How to call the built-in jre from the command line to run Java applications

Can I associate a JRE with an exported standalone Java application? We have a very specific requirement for running the stand-alone AnyLogic Java application on a computer on which the latest version of Java is not installed, and due to the company's IT policies, we will not be able to do this.

In some research, I found that some sites claim that they already did this for Windows and Mac.

Using the JRE on OSX https://wiki.openjdk.java.net/display/MacOSXPort/How+to+embed+a+.jre+bundle+in+your+Mac+app http://www.intransitione.com/blog / take-java-to-app-store /

My problem is that most of these messages are bundled with an application for Mac OS x and require jar files to be created in an IDE such as Eclipse. But since I use AnyLogic, jar files are exported without the possibility of intervention. I need to change the command line code that runs jar files, and currently looks like this:

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 $*

(Note: code reduced for readability)

into something that I assume will pass a jre or JVM to be used as an argument for calling java. Or maybe install the directory that will be used for java or something ... because calling a java command on a machine without java installed does nothing.

, jdk, moneydance, Java, OSx jre, .

https://www.dropbox.com/sh/1bedimsb0lj403t/AADYR7iFoBD4YiqS_RGZ2xAVa?dl=0

+4
2

, Stack Exchange, , , :

, jre , , java . Windows Mac , :

Mac

jre . , , Mac, , hidded finder, shift-g

/Library/Java/JavaVirtualMachines/

jdk,

jdk1.8.0_45.jdk/Contents/Home/jre 

Windows

jre

c:\Program Files\Java\

.bat, AnyLogic , :

@SET PATH_XJAL="%DISK_XJAL%\Program Files\Java\jre6\bin\java.exe"

, , java. mac, windows.bat

Mac

java -Xdock:name="AnyLogic Model"

to

./jre/bin/java -Xdock:name="AnyLogic Model"

Windows

    @SET PATH_XJAL="%DISK_XJAL%\Program Files\Java\jre6\bin\java.exe"

to

   @SET PATH_XJAL= \jre6\bin\java.exe"

java Mac Windows Java

+2

Exe4J. , , exe , . ( : AL7-dbase, ).

0

Source: https://habr.com/ru/post/1648008/


All Articles