LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Java path problems in Ubuntu 7.04 (https://www.linuxquestions.org/questions/linux-software-2/java-path-problems-in-ubuntu-7-04-a-644855/)

nexl 05-26-2008 10:00 AM

Java path problems in Ubuntu 7.04
 
Hi All,
I installed JDK1.5_15 on my Ubuntu 7.04.When Iam executing "java -version"
the old gcj version 1.4.2 is reported .I added the path in .bashrc
When I executed the "which java" command its searching in /usr/bin/java.

Iam new to java and Linux.Can any one tell me where I went wrong.


Thanks in Advance.

Nex

indienick 05-26-2008 11:33 AM

Right I recommend removing that POS (Piece of Sh*t) called GCJ? I only keep it around for some basic Java-to-native-binary compiling, but for the most part, GCJ just confuses Java programmers to no end due to the fact that if you've never programmed and compiled C or C++ programs in Linux (or UNIX), half of the necessary flags you need to pass to the compiler make no sense.

Simply, uninstall GCJ and cross your fingers in hoping it's not tied into the GCC package (which, I don't believe it is).

knudfl 05-26-2008 11:43 AM

It is easier to do the install with 'sudo apt-get install sun-java5-jre'
(or use synaptic)
Then all links to 'gcj-4.2' will change. So when typing 'java -version'
in a terminal, the answer should be:
"java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)"

Rgds
Edit: Sorry, indienick, I didn't see your answer while typing the above lines.
P.S.: Synaptic : Removing 'gcj-4.2' will install 'sun-java6-jre'

indienick 05-26-2008 02:21 PM

It's all good, knudfl. :)


All times are GMT -5. The time now is 10:50 AM.