My application is packed into 1 jar file and run by this command: "java -jar myapp.jar".
I config all the class paths in the manifest.mf file
How to tell in the command line (or other place) what JRE version to use?
Printable View
My application is packed into 1 jar file and run by this command: "java -jar myapp.jar".
I config all the class paths in the manifest.mf file
How to tell in the command line (or other place) what JRE version to use?
thanks Jos, but I didn't understand what you mean.
I need to know what to change in this command "java -jar myapp.jar" in order to run myapp.jar with jre version 6.
Since I have jre 1.4.2 and jre 6 installed in my computer.
Have you tried using -version:<value>?Code:Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
Quote:
I have jre 1.4.2 and jre 6 installed in my computer
D:\java\jre1.4.2\bin\java.exe -jar jarfile.jarQuote:
Use the absolute path for the java command.
it works fine.tnx:(nod):