Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have installed eclipse and when I launch it it says:
Incompatible JVM (as superuser)
Version 1.4.2 of the JVM is not suitable for this product. Version 1.5 or greater is required"
The readme jsut says to go their website and view the licencereadme file.
OK Now I have it extracted into a folder jdk1.7.0_04
How do I make this the default java install directory??
I'm not sure what did you mean by 'the default java install directory' but you may want setting/exporting your JAVA_HOME env variable to this directory so eclipse would know that this version is in place.
How do I make this the default java install directory??
I don't think you would.....i assume that it is a directory with files and instructions for installing TO the appropriate place. An installer will often prompt you for this. FWIW-mine is in /usr/lib and /usr/bin
So--is there a "README" or other documentation in that new folder?
Distribution: MontaVista Linux Version 4.0.1, Professional Edition
Posts: 215
Original Poster
Rep:
I have done the following:
1. Downloaded jre-7u4-linux-x64.tar.gz from oracle.com
2. Extracted it and changed my JAVA_HOME env variable to where I extracted it to: /home/myusername/java/jrel.7.0_04/
But when I now try to launch eclipse I still get the original error!!!
Here is what I do:
First, you can use the tar/gz file, but I usually just get the binary and run it as root. I usually create a java directory in /usr unless I'm working with the production servers where sysops makes me put it in /usr/local. No big deal either way.
This is what I usually do.
Now that java stack is created, I've got one jdk1.6.0_24, path looks like this:
/usr/java/jdk1.6.0_24/all the java stuff in here
Create a symbolic link: /usr/java/jdk -> /usr/java/jdk1.6.0_24/
Create env variable in profile: JAVA_HOME=/usr/java/jdk
Add to path in profile $JAVA_HOME/jre/bin:$JAVA_HOME/bin
Now you've got java, javac, keytool, jps, etc. all working.
The jdk sym link is good because it simplifies updating your java. No one needs update their profile when updates are made, you just repoint sym link.
Regarding your question about default java.
Enter: which java
For me, using Fedora, I get back /usr/bin/java.
Do a "file" on that, and it shows that it is a symbolic link to the ootb java. After installing new java, I drop and reset that symbolic link to my new java location: JAVA_HOME/jre/bin/java
The good thing about doing this is that any user will run the same version since /usr/bin is usually automatically part of the path. If you want, create sym links in /usr/bin for javac as well, javaws, etc.
So, you've added jre1.7.0_04/bin to your path and java -version still shows version 1.4.2? It should show 'java version "1.7.0_04"' instead.
Anyhow, if it is showing the new version then for some reason eclipse is still seeing the old java version. Can you try running eclipse with the '-vm' option specified on command line and see if it will work. Something like:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.