LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Java Run Time Environment (https://www.linuxquestions.org/questions/linux-software-2/java-run-time-environment-654822/)

shahz 07-10-2008 05:43 AM

Java Run Time Environment
 
I have installed jre within Red Hat Enterprise linux. its successfully installed, when I run the command

#java -version I get the following.

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)


but when I start installing greenstone I get for now this error I think it have some thing with path can any body help me.

This application requires a Java Run Time Environment (JRE)
to run. Searching for one on your computer was not successful.
Please use the command line switch -is:javahome to specify
a valid JRE. For more help use the option -is:help.


I know that the jre is installed I think I have to do something with javahome. ???????


thanks
shahz

pixellany 07-10-2008 06:14 AM

Have you checked that the location of the java binaries is in your PATH variable? To check, enter this in a terminal:

echo $PATH

shahz 07-10-2008 06:40 AM

#echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin


I added this to my path and now path looks like this way

#PATH=$PATH:/usr/java/jre1.6.0_07/bin/java

after this the

#echo $PATH (looks like this)

usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/java/jre1.6.0_07/bin/java

but still the same error I searched for java with the following command and got this lisiting.

#find / -name java

/etc/java
/usr/bin/java
/usr/share/doc/libidn-devel-0.5.6/contrib/java
/usr/share/doc/db4-devel-4.2.52/ref/java
/usr/share/apps/kdevfilecreate/file-templates/java
/usr/share/apps/kdevappwizard/imports/java
/usr/share/javadoc/java
/usr/share/java
/usr/lib/swig1.3/java
/usr/lib/gcc/i386-redhat-linux/3.4.3/include/gnu/java
/usr/lib/gcc/i386-redhat-linux/3.4.3/include/java
/usr/lib/java
/usr/java
/usr/java/jre1.6.0_07/bin/java
/home/najo/gsdl-2.80-unix/gsdl/bin/java
/home/najo/gsdl-2.80-unix/src/src/java

did I gave the right command for the binary or not.

thanks for help

shahz

pixellany 07-10-2008 06:54 AM

I think you don't want that last "java" in the PATH. PATH should contain only the directory path, not the final file to be run.

Here is the relevant stuff from my machine:
Code:

[mherring@localhost bin]$ find /usr -name java
/usr/share/fonts/java
/usr/share/java
/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/bin/java
/usr/lib/ooo-2.2/share/Scripts/java
/usr/bin/java

[mherring@localhost bin]$ echo $PATH
/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:sbin:/usr/sbin:/usr/games:/usr/lib/qt3//bin:/home/mherring/bin:/usr/lib/qt3//bin

Note that the only relevant entry in PATH is "/usr/bin"

shahz 07-10-2008 07:01 AM

Quote:

Originally Posted by pixellany (Post 3209951)
[/CODE]Note that the only relevant entry in PATH is "/usr/bin"


tried the /usr/bin also with the command.

#PATH=$PATH:/usr/bin

but still get the same error



thanks
shahz

shahz 07-10-2008 07:07 AM

and one more thing if I say

#which java (it says /usr/bin/java)

#rpm -qf /usr/bin/java
file /usr/bin/java is not owned by any package


thanks
shahz

shahz 07-12-2008 12:07 AM

thanks pixellany

it finally works I had the path problem, but it works with 1.5 not with 1.6

thank you very much.


thanks
shahz

williebens 07-12-2008 06:59 AM

Hello guys:

To follow this thread, I will post how I got the java 1.6 path working on my Centos 5.0 box.
This is just in case someone needs this reference.

Set the JAVA_HOME environment variable to /usr/java/jdk1.6.0_06:

Indeed, there is more than one way of doing this. I chose to do it by creating a file
under the /etc/profile.d directory with the following content:

#This file was created
#to add the environment variable $JAVA_HOME
#to this system with the location of the JDK.
#This is for the use of the JDK environment
#for all users.

JAVA_HOME=/usr/java/jdk1.6.0_06
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH

I called this file tomcat_env.sh because I was installing tomcat 6.0 and it needed the java 1.6 environement, but you can call it anything you want. You need to make it executable by running the following command:

[root@linuxbox profile.d]# chmod +x tomcat_env.sh

Now check its permissions. You should get:
[root@linuxbox profile.d]# ls –l
-rwxr-xr-x 1 root root 288 May 1 13:47 tomcat_env.sh

Run the tomcat_env.sh file to se the environment variable:
[root@linuxbox profile.d]# ./tomcat_env.sh

Verify it is set by running the echo command:

[root@linuxbox profile.d]# echo $JAVA_HOME
/usr/java/jdk1.6.0_06/
[root@linuxbox profile.d]#

[root@linuxbox profile.d]# echo $PATH
/usr/java/jdk1.6.0_06/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/lo
cal/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bi n:/root/bin
[root@linuxbox profile.d]#

shahz 07-13-2008 11:43 PM

dear williebens

I also was able to install 1.6 but what was the problem that my software with 1.6 was having some problem thats why I was happy with 1.5 any how thanks


shahz


All times are GMT -5. The time now is 10:41 PM.