31/01/2009 19:07

Run java with specific JRE version

Se si cerca su internet l'opzione -version: non è riportata. Se invece si lancia java dalla console (avendo installato il jdk) tra le opzioni di lancio della JVM c'è la possibilità di specificare una versione di JRE. Naturalmente se la versione non esiste sarà generata un'eccezione

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

D:\Documents and Settings\f.rosa>java
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM
    -server       to select the "server" VM
    -hotspot      is a synonym for the "client" VM  [deprecated]
                  The default VM is client.

    -cp
    -classpath
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D=
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:
                  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[: ...|:]
    -enableassertions[: ...|:]
                  enable assertions
    -da[: ...|:]
    -disableassertions[: ...|:]
                  disable assertions
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib: [= ]
                  load native agent library , e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath: [= ]
                  load native agent library by full pathname
    -javaagent:[= ]
                  load Java programming language agent, see java.lang.instrument

    -splash:
                  show splash screen with specified image

—————

Indietro


Crea un sito gratis Webnode