PDA

View Full Version : [ubuntu] 8.04 Java Sun JDK 1.4.2 install doesn't work



manoswerts
May 20th, 2008, 02:06 PM
Hi everyone,

I downloaded the bin file for the JDK 1.4.2. I need it because i need to program for Canon and the network printers only support that java version.

I installed the bin like this :



chmod a+x jdk_file_name.bin
sudo ./jdk_file_name.bin


it ended up in a map with all the files in it. I moved the file to my /usr/lib/jvm

Next step is that i set the JAVA_HOME in the following manner :


sudo gedit /etc/environment

and I added JAVA_HOME="path_to_javafolder" at the top of the file.

now when i do


sudo update-alternatives --config java

my java doesn't show up in the list.
How come?

Thanks in advance.

dstew
May 20th, 2008, 05:09 PM
You are supposed to substitute the real path name for "path_to_javafolder"

manoswerts
May 20th, 2008, 09:07 PM
Well I did that ;) I'm not quite that stupid :D

dstew
May 20th, 2008, 09:46 PM
I did not mean to insult your intelligence, but you never know around here :-)

Did you check to see if the symlink java is present in the /etc/alternatives directory?

manoswerts
May 21st, 2008, 08:20 AM
Well there is a link called "java" that links to /usr/lib/jvm/java-6-sun/jre/bin/java.
The same with javac (linked to /usr/lib/jvm/java-6-sun/bin/javac) and so on..

I thought that installing the bin file would handle everything for me, but I guess I was wrong. So if I understand you correctly, I need to add a link to the java.jar, java.jar, etc in /usr/lib/jvm/jsdk2.4.1/? But how do i have to call it?

By the way, I want my java 6 to stay the default java, so I think that replacing the original java-link wouldn't be the solutions I'm looking for.

dstew
May 21st, 2008, 01:31 PM
My guess is that the .bin file has to be run from the proper place with the proper permissions. On the Sun web site, they recommend running as an ordinary user, and not as root. Maybe that is part of your problem since you ran the .bin file as root. I want to try to install this too, but I am not at my Linux computer at present, I will try later.

The update-alternatives command has to do with a Debian system that gives you choices when you enter a command, I think. It keeps track of the various java programs, and keeps the links to them in some kind of order. I have not been using it, but my impression is that if you enter a command like java the shell should then give you a list of choices. Maybe look at the man page for update-alternatives to get some clues as to how to get it to work properly. It also might have to do with running the .bin as root or as a user.

manoswerts
May 22nd, 2008, 03:39 PM
The update-alternatives command let you set the default java version. When you run the command you get a list and you can select the default java to use. I ran it and selected java 6. But after installing 1.4.2 the list didn't expand. The 1.4.2 version wasn't available in the list, so I concluded that it isn't (properly) installed.