Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Setting CLASSPATH, PATH, and LD_LIBRARY_PATH  linux

Posted on 2002-04-23
8
608 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 65
servlet web applications   metadata-complete="true" or false 3 112
Chrome and Firefox Java 5 50
passing enum to a method 4 21
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

861 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