Ubuntu en java

Posted by Paul Verreth Tue, 09 Jan 2007 11:34:00 GMT

Standaard is Ubuntu (en ook Debian) voorzien van de GNU Java bytecode interpreter (gij) als package

Dit kan je merken door de usage van java

java

Usage: gij [OPTION] ... CLASS [ARGS] ...
          to invoke CLASS.main, or
       gij -jar [OPTION] ... JARFILE [ARGS] ...
          to execute a jar file
Try `gij --help' for more information.

Deze java interpreter kan voor sommige toepassigen problemen geven. Bij RadRails – Eclipse is dat zeker zo.

Daarvoor is het beter om sun-java5-jre te installeren, te vinden in de multiverse repo.

De usage van java geeft dan wat we er van verwachten:

java

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -d32          use a 32-bit data model if available

    -d64          use a 64-bit data model if available
    -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 <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
/usr/bin/java is een symlink naar /etc/alternatives/java, welke op zijn beurt een symlink is naar /usr/lib/jvm/java-1.5.0-sun/jre/bin/java. In het oorspronkelijke geval is /etc/alternatives/java een symlink naar /usr/bin/gij.

Als je jre6 wil installeren, of eender welke SUN JRE voor debian, kan je die downloaden bij java.sun.com, daarna uitpakken in /usr/java, en dan een symbolic link maken in van /etc/alternatives/java naar /usr/java/jre-XXX-XXX/bin/java.

Posted in ,  | Tags , ,

Comments are disabled