Solved

Setting CLASSPATH, PATH, and LD_LIBRARY_PATH  linux

Posted on 2002-04-23
8
592 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:yassin092898
  • 5
  • 3
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6964438
Make the following changes:

JAVA_HOME=/usr/java/j2sdk1.4.0
PATH=$PATH:$HOME/BIN:$JAVA_HOME/bin:.
0
 

Author Comment

by:yassin092898
ID: 6966145
I am getting these error from javac

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

Thanks
0
 
LVL 92

Expert Comment

by:objects
ID: 6967076
Try adding the following as well:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib
0
 

Author Comment

by:yassin092898
ID: 6969515
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 92

Expert Comment

by:objects
ID: 6969844
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
 

Author Comment

by:yassin092898
ID: 6991352
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
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 6992518
Try adding /usr/java/j2sdk1.4.0/jre/lib/i386 to your LD_LIBRARY_PATH.
0
 
LVL 92

Expert Comment

by:objects
ID: 6997708
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse package explorer vs project explorer view 2 73
backtracking recursion  code 19 53
Apps blocked by Java 9 55
more than one jdk and one jre 1 30
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now