Setting CLASSPATH, PATH, and LD_LIBRARY_PATH linux

New to linux
I just installed j2sdk in Linux redhat. I installed the files in /usr/java/j2sdk1.4.0
The above directory contains
jre , lib , inlcude etc.

I use .bash_profile to set my PATH and here are some entries

PATH=$PATH:$HOME/BIN:.
BASH_ENV=$HOME/.bashrc
USERNAME:root

How should configure to make javac work.

Thanks
yassin092898Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
objectsConnect With a Mentor Commented:
Try adding /usr/java/j2sdk1.4.0/jre/lib/i386 to your LD_LIBRARY_PATH.
0
 
objectsCommented:
Make the following changes:

JAVA_HOME=/usr/java/j2sdk1.4.0
PATH=$PATH:$HOME/BIN:$JAVA_HOME/bin:.
0
 
yassin092898Author Commented:
I am getting these error from javac

Error : could not find libjava.so
Error : could not find Java 2 Runtime Environment

Thanks
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
objectsCommented:
Try adding the following as well:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib
0
 
yassin092898Author Commented:
I still have the same problem.

I use bash as my commnad shell and .bash_profile to set my PATH and here are some entries


JAVA_HOME=/usr/java/j2sdk1.4.0
PATH=$PATH:$HOME/bin:$JAVA_HOME:$JAVA_HOME/jre/lib/i386:.
CLASS_PATH==/usr/java/j2sdk1.4.0/lib/i386
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CLASSPATH
BASH_ENV=$HOME/.bashrc
USERNAME:root

I am getting the same erros from javac

Error : could not find libjava.so
Error : could not find Java 2 Runtime Environment


Thanks
0
 
objectsCommented:
Remove that CLASSPATH entry.
And try replace the one below it with:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib/i386

WHich dir is libjava.so actually in?
(And include that directory in LD_LIBRARY_PATH).
0
 
yassin092898Author Commented:
libjava.so is in

/usr/java/j2sdk1.4.0/jre/lib/i386

is there any way I can tell javac where to find the library using the command line.

Thanks
0
 
objectsCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.