Forums Register Login

PATH and CLASSPATH settings in Linux

+Pie Number of slices to send: Send
i had made CLASSPATH and PATH settings in RedHat Enterprise 5 version in the followed way in .bashrc file

export JAVA_HOME=/usr/jre1.7.0_10/


export PATH=$PATH:/usr/jre1.7.0_10/bin:
export CLASSPATH=$CLASSPATH:/usr/jre1.7.0_10/lib:


after setting i saved .bashrc and i did run the .bashrc in followed way.
[root@localhost ~]# sh .bashrc
[root@localhost ~]# java -version


After entering java -version i am getting followed error .Please tell me how to solve this error , why this error is coming when java -version command typed with reasons.

Error: dl failure on line 864
Error: failed /usr/jre1.7.0_10/lib/i386/client/libjvm.so, because /usr/jre1.7.0_10/lib/i386/client/libjvm.so: cannot restore segment prot after reloc: Permission denied.


ThankYou..



+Pie Number of slices to send: Send
You do no need to add /usr/jre1.7.0_10/lib to the class path since the jars in the JDK/JRE distribution are automatically added to the class path when you invoke 'java' .
+Pie Number of slices to send: Send
I had not installed JDK in OS . I simply placed JRE folder in /usr directory...
+Pie Number of slices to send: Send
A quick search found that this error is usually associated with SELinux (I think Security Enhanced Linux, a sort of firewall installed on some versions of Linux, including Red Hat 5, if I understand it correctly).

The quick-test solution is to disable selinux using setenforce 0 then seeing if it Java works. Then turn it back on using setenforce 1. If that works for you then you should find the SELinux configuration (some versions of Linux have a GUI configurator, and others do not). What you want to do is allow Text Relocation, so in the GUI look for something like "Allow the use of shared libraries with Text Relocation". Or, I think, you could use a command line to allow Text Relocation just for the jvm:

However, I am not an expert on this matter, I just did some quick research. Using the above command lines could cause security problems or might lead to the same problem on other scripts. So please research further yourself.
1
+Pie Number of slices to send: Send
 

Gangireddy Danam wrote:I had not installed JDK in OS . I simply placed JRE folder in /usr directory...



You still do not need to add /usr/jre1.7.0_10/lib to the class path ! As long as the PATH points to the JRE bin directory it will pick up the correct jars.
+Pie Number of slices to send: Send

@Steve Luke
ThankYou Sir..It's working fine..
+Pie Number of slices to send: Send
Gangireddy Danam,
Your post was moved to a new topic.
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 7737 times.
Similar Threads
how to setup JAVA_HOME and JAVA_PATH
java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter
Configuring Eclipse in Linux
Java Runtime Environment
how to uninstall java 1.5?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:33:39.