• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

PATH and CLASSPATH settings in Linux

 
Ranch Hand
Posts: 32
Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..



 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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' .
 
Gangireddy Danam
Ranch Hand
Posts: 32
Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had not installed JDK in OS . I simply placed JRE folder in /usr directory...
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Richard Tookey
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Gangireddy Danam
Ranch Hand
Posts: 32
Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

@Steve Luke
ThankYou Sir..It's working fine..
 
Marshal
Posts: 73001
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gangireddy Danam,
Your post was moved to a new topic.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic