Getting Java 1.5 Installed on my Linux System

K

kvnsmnsn

I'm sitting here with twenty midterms to grade for the Intro to Compu-
ter Science class at Brigham Young University. The students have
written their solutions with Java 1.5, many of them using <Scanner>
for input from the terminal. My brother-in-law, to whom I am much in
debt, has installed Linux on my laptop complete with a Java compiler,
but alas, he set me up with version 1.4. So I went to "java.sun.com"
and downloaded "jdk-1_5_0_05-linux-i586.bin" and ran that file on my
Linux machine. That created an install file that I made executable
and ran, and it created "java" and "javac" binaries. But when I type
in "./java -version" I get the message: "Error occurred during ini-
tialization of VM," and something about no Java object being found.

Does anybody know what I need to do to get a working Java 1.5 on my
machine? Is this error message telling me something I'm missing? Any
information on this would be greatly appreciated.

---Kevin Simonson

"You'll never get to heaven, or even to LA,
if you don't believe there's a way."
from _Why Not_
 
J

Jon Martin Solaas

Roedy said:
Try uninstalling 1.4 then install the JDK 1.5

Or simply make sure PATH and JAVA_HOME points to the correct version of
java. You may even be confused by the gcc java stuff here.

export JAVA_HOME=/usr/local/java/jdk15
export PATH=$JAVA_HOME/bin:$PATH

People also provide various java package repositories to make things
simpler (but I don't think it gets much simpler than the two above
commands). Try www.jpackage.org to check it out for yourself.
 
T

Thomas Hawtin

I'm sitting here with twenty midterms to grade for the Intro to Compu-
ter Science class at Brigham Young University. The students have
written their solutions with Java 1.5, many of them using <Scanner>
for input from the terminal. My brother-in-law, to whom I am much in
debt, has installed Linux on my laptop complete with a Java compiler,
but alas, he set me up with version 1.4. So I went to "java.sun.com"
and downloaded "jdk-1_5_0_05-linux-i586.bin" and ran that file on my
Linux machine. That created an install file that I made executable
and ran, and it created "java" and "javac" binaries. But when I type
in "./java -version" I get the message: "Error occurred during ini-
tialization of VM," and something about no Java object being found.

You don't say which flavour of Linux you are running. Quite probably it
is the slightly dodgy GNU reimplementation of Java.

On my Fedora Core 4 machine, I get:

[tackline@new scratch]$ java -version
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b61)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b61, mixed mode, sharing)
[tackline@new scratch]$ /usr/bin/java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[tackline@new scratch]$ whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java

The Sun version of Java should be in /usr/java. In order to use it,
either run with the full name of the executable:

/usr/java/jdk1.6.0/bin/javac *.java

Or insert the JDK bin directory before /usr/bin in your PATH. From my
~/.bashrc:

export JAVA_SE6=/usr/java/jdk1.6.0
export JAVA_HOME=$JAVA_SE6
export PATH=${JAVA_HOME}/bin:${PATH}

Tom Hawtin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top