LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2011, 11:24 AM   #1
Mark_667
Member
 
Registered: Aug 2005
Location: Manchester, England
Distribution: Ubuntu 20.04
Posts: 383

Rep: Reputation: 30
Java in PATH but not found by applications?


I'm setting up a RHEL 4 VM and have installed Oracle Java 1.6 from a bin file to /opt. I've added it into the PATH but when I try to run a installer that needs Java to run it says that it can't find a Java installation in my PATH but when I execute a which java I get the following:

Quote:
# which java
/usr/bin/which: no java in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/opt/jre1.6.0_23/bin/java:/root/bin:$/opt/jre1.6.0_23/bin/:$)
#
Can anyone tell me what's going on here?
 
Old 02-01-2011, 11:49 AM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
I've added it into the PATH but when I try to run a installer that needs Java
informing us as to what this " installer " is would help
rhel4 .? .0.1.2.3.4.5.6.7.8 or the CURRENT 4.9 ???
point what ???

rhel4 might not be supported by this program ( is is locked into 5 year old code after all)

also will the current java 1.6 even run on rhel4.0 ???
 
Old 02-01-2011, 12:05 PM   #3
ADxD_7
Member
 
Registered: May 2007
Location: CO
Distribution: Solaris , Redhat , Debian
Posts: 152

Rep: Reputation: 23
I would say show us with an ls -al exactly where java is please - also I may have just never seen it but whats with the "$" in your path? All you should need (if java is in /opt/jre1.6.0_23/bin) is /opt/jre1.6.0_23/bin in your path....
 
Old 02-01-2011, 12:14 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
with Java, sometimes you have to set the "Java_Home" variable instead.

/root/.bash_profile

Quote:
export JAVA_HOME=/usr/java
 
Old 02-02-2011, 10:38 AM   #5
Mark_667
Member
 
Registered: Aug 2005
Location: Manchester, England
Distribution: Ubuntu 20.04
Posts: 383

Original Poster
Rep: Reputation: 30
#uname -ar
Linux <hostname> 2.6.9-42.ELsmp #1 SMP <date> i686 i686 i386 GNU/Linux
#

The installer is InstallAnywhere.

According to this:
http://www.java.com/en/download/help/6000011000.xml
Java 6 is supported.

# ls /opt/jre1.6.0_23/
bin javaws man README Welcome.html
COPYRIGHT lib plugin THIRDPARTYLICENSEREADME.txt
#
Don't know what you want this for, but there you go.

Also, I tried setting JAVA_HOME to /opt/jre1.6.0_23 where I instyalled it and logged off and on again but it made no difference.
 
Old 02-02-2011, 01:02 PM   #6
ADxD_7
Member
 
Registered: May 2007
Location: CO
Distribution: Solaris , Redhat , Debian
Posts: 152

Rep: Reputation: 23
Quote:
Originally Posted by Mark_667 View Post
#uname -ar
Linux <hostname> 2.6.9-42.ELsmp #1 SMP <date> i686 i686 i386 GNU/Linux
#

The installer is InstallAnywhere.

According to this:
http://www.java.com/en/download/help/6000011000.xml
Java 6 is supported.

# ls /opt/jre1.6.0_23/
bin javaws man README Welcome.html
COPYRIGHT lib plugin THIRDPARTYLICENSEREADME.txt
#
Don't know what you want this for, but there you go.

Also, I tried setting JAVA_HOME to /opt/jre1.6.0_23 where I instyalled it and logged off and on again but it made no difference.
What I really wanted was an ls of /opt/jre1.6.0_23/bin but thats cool - I just want to actually see the java executable in case it is a link that is not working as many times "java" is just a link to the current version - can you run /opt/jre1.6.0_23/bin/java? Is it even there? This is at least the starting point of finding the problem - I mean at this point we need to figure out if it is a problem with the way java was installed or if it is a path issue or something else entirely.
 
Old 02-02-2011, 01:48 PM   #7
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
You need to remove the '/opt/jre1.6.0_23/bin/java' entry and remove the '$' from the last entry for starters.
 
Old 02-02-2011, 03:48 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
what is this " installer " that can not find the different install of java .
Different than the base default .

that program might be the problem.
 
Old 02-03-2011, 05:39 AM   #9
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
The program is the problem, it's Oracle installer.
szboardstretcher is correct

with Java, sometimes you have to set the "Java_Home" variable instead.

/root/.bash_profile


Quote:
export JAVA_HOME=/usr/java
 
Old 02-03-2011, 10:30 AM   #10
Mark_667
Member
 
Registered: Aug 2005
Location: Manchester, England
Distribution: Ubuntu 20.04
Posts: 383

Original Poster
Rep: Reputation: 30
Quote:
can you run /opt/jre1.6.0_23/bin/java?
Yes, just executing that command gives me a usage page for it.
Quote:
You need to remove the '/opt/jre1.6.0_23/bin/java' entry and remove the '$' from the last entry for starters.
Done, I also set JAVA_HOME while I was in there, I logged out and in again for the PATH changes to take affect but it didn't make any difference.
 
  


Reply

Tags
java, path



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
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-13-2009 11:25 PM
No Java virtual machine could be found from your PATH stefaandk *BSD 2 09-28-2008 08:11 PM
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 03:11 PM
ErrorMessage "Java virtual machine could be found from your PATH .. What do i Do ? murbz Linux - Software 18 11-09-2004 05:30 AM
"No Java virtual machine could be found from your PATH" - ignores bashrc shaider Linux - Software 7 10-09-2004 12:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:16 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration