LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 08-22-2006, 11:49 PM   #1
ssa2204
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Rep: Reputation: 0
Java - JAVA_HOME problem after upgrade


I updated to the latest Java version that was available through Smart, going from 1.42 to 1.5.0.6. The program I am trying to run, Ninan, give me the error "touch: cannot touch `restart': Permission denied" from which as I understand has to do with the running with pre-1.5 Java versions. My best guess now is I need to set enviroment variables, but I am lost at this. Where exactly should JAVA_HOME point to? Anything else I may be doing wrong?

Here is the directory /usr/lib64/jvm/java-1.5.0-sun-1.5.0_06>:

drwxr-xr-x 2 root root 968 Aug 22 23:13 bin
drwxr-xr-x 3 root root 224 Aug 22 23:13 include
drwxr-xr-x 4 root root 96 Aug 22 23:13 jre
drwxr-xr-x 2 root root 216 Aug 22 23:13 lib
-rw-r--r-- 1 root root 17527191 Nov 10 2005 src.zip

Under "JRE" I have both bin and lib again.

This is what I have for /etc/java/java.conf:
# Location of jar files on the system
JAVA_LIBDIR=/usr/share/java
# Location of arch-specific jar files on the system
JNI_LIBDIR=/usr/lib64/java
# Location of 32 bit arch-specific jar files on the system
JNI_LIBDIR32=/usr/lib/java
# Root of all native JVM installations
JVM_ROOT=/usr/lib64/jvm
# Root of all 32 bit JVM installations
JVM_ROOT32=/usr/lib/jvm
# You can define a system-wide JVM root here if you're not using the default one
#JAVA_HOME=$JVM_ROOT/java-bea
# Options to pass to the java interpreter
JAVACMD_OPTS=
 
Old 08-23-2006, 12:04 AM   #2
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
Presumably, /usr/share/java is a link pointing at /usr/lib64/jvm/java-1.5.0-sun-1.5.0_06

$ ls -l /usr/share/java should verify that

Assuming that's true, all you should need to do is change the part of /etc/profile that looks like this:
Code:
export PATH

umask 022
...to this:
Code:
export PATH

JAVA_HOME="/usr/share/java"
export JAVA_HOME

umask 022
...and reboot.
 
Old 08-23-2006, 12:15 AM   #3
ssa2204
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for replying. Doing ls -l /usr/share/java give me this:
total 6718
-rw-r--r-- 1 root root 6417002 Jun 16 08:20 libgcj-4.1.0.jar
-rw-r--r-- 1 root root 452636 Jun 3 09:21 mysql-connector-java-3.1.13.jar
lrwxrwxrwx 1 root root 31 Aug 22 23:15 mysql-connector-java.jar -> mysql-connector-java-3.1.13.jar

Basically under /usr/share/ I have nothing but empty directories (refering to Java).

/usr/share/java-1.4.2 and /usr/share/java-1.5.0 are empty.
 
Old 08-23-2006, 12:25 AM   #4
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
That's not it. I don't know what distro you're using, but in order to set JAVA_HOME, you have to know where your package manager stored the JRE.

In Debian it's /usr/lib/j2re1.5-sun/ ... Too bad every distro doesn't do things the Debian way ... I could successfully answer more questions.
 
Old 08-23-2006, 12:40 AM   #5
ssa2204
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
I installed this using Smart, distrobution is Suse Enterprise Desktop 10. I just took a look at what Smart installed under the content description. All they list are the directories, but not what files and where of course.

/usr/share/java-1.5.0-sun is listed, but then again this directory is empty.

I do have however
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_06/jre/
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_06/jre/bin/
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_06/jre/lib/


So should I do JAVA_HOME="/usr/lib64/jvm/java-1.5.0-sun-1.5.0_06/jre/"? i.e. run in terminal "export JAVA_HOME=/usr/lib64/jvm/java-1.5.0-sun-1.5.0_06/jre/"

When I instaled Java, I also selected java-src, plugin, alsa, jdbc, and devel if that helps any. Am I correct to maybe think that Smart did not correctly install Java? At the very least it did not do a complete job in removing the old version files as I expected it would.

Another thing, right now I have done JAVA_HOME=/usr/lib64/jvm/java-1.5.0-sun-1.5.0_06/jre/. If this is the incorrect path, then I should not be able to run Java programs correct? I fired up Limewire and it had no problems loading. On the other hand Firefox no longer sees that Java is installed.

Last edited by ssa2204; 08-23-2006 at 01:17 AM.
 
Old 08-24-2006, 06:32 PM   #6
ssa2204
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Just update:

If I run whereis java, I get this:
Suse10:~ # whereis java
java: /usr/bin/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gztor

The directory /usr/share/java is empty.

One last command I was told to use by someone but they did not explain in detail how this would help...

Suse10:~ # /usr/sbin/update-alternatives --display java
java - status is auto.
link currently points to /usr/lib64/jvm/jre-1.5.0-sun/bin/java
/usr/lib64/jvm/jre-1.5.0-sun/bin/java - priority 1503
slave ktab.1.gz: /usr/share/man/man1/ktab-java-1_5_0-sun.1.gz
slave keytool.1.gz: /usr/share/man/man1/keytool-java-1_5_0-sun.1.gz
slave rmid.1.gz: /usr/share/man/man1/rmid-java-1_5_0-sun.1.gz
slave orbd.1.gz: /usr/share/man/man1/orbd-java-1_5_0-sun.1.gz
slave rmid: /usr/lib64/jvm/jre-1.5.0-sun/bin/rmid
slave servertool.1.gz: /usr/share/man/man1/servertool-java-1_5_0-sun.1.gz
slave javaws.1.gz: /usr/share/man/man1/javaws-java-1_5_0-sun.1.gz
slave jre_exports: /usr/lib64/jvm-exports/jre-1.5.0-sun
slave policytool.1.gz: /usr/share/man/man1/policytool-java-1_5_0-sun.1.gz
slave policytool: /usr/lib64/jvm/jre-1.5.0-sun/bin/policytool
slave orbd: /usr/lib64/jvm/jre-1.5.0-sun/bin/orbd
slave rmiregistry: /usr/lib64/jvm/jre-1.5.0-sun/bin/rmiregistry
slave tnameserv: /usr/lib64/jvm/jre-1.5.0-sun/bin/tnameserv
slave rmiregistry.1.gz: /usr/share/man/man1/rmiregistry-java-1_5_0-sun.1.gz
slave keytool: /usr/lib64/jvm/jre-1.5.0-sun/bin/keytool
slave tnameserv.1.gz: /usr/share/man/man1/tnameserv-java-1_5_0-sun.1.gz
slave klist.1.gz: /usr/share/man/man1/klist-java-1_5_0-sun.1.gz
slave servertool: /usr/lib64/jvm/jre-1.5.0-sun/bin/servertool
slave java.1.gz: /usr/share/man/man1/java-java-1_5_0-sun.1.gz
slave kinit.1.gz: /usr/share/man/man1/kinit-java-1_5_0-sun.1.gz
slave jre: /usr/lib64/jvm/jre-1.5.0-sun
/usr/lib64/jvm/jre-1.4.2-gcj/bin/java - priority 1419
slave jre_exports: /usr/lib64/jvm-exports/jre-1.4.2-gcj
slave rmiregistry: /usr/lib64/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre: /usr/lib64/jvm/jre-1.4.2-gcj
Current `best' version is /usr/lib64/jvm/jre-1.5.0-sun/bin/java.
Suse10:~ #
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem setting JAVA_HOME pkpro1 Linux - General 5 11-25-2007 08:49 AM
Problem setting JAVA_HOME when installing jdk1.5 RVDowning Mandriva 4 08-02-2006 07:38 AM
Problem with Java Upgrade 1.5.0_06 Romanator Linux - Software 3 02-09-2006 06:59 PM
setting JAVA_HOME gauravbagga Linux - Newbie 2 03-04-2005 09:17 PM
JAVA_HOME Variable yea420 Linux - Software 6 08-29-2004 06:37 PM


All times are GMT -5. The time now is 02:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration