Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

problem with jar: (could not find libjava.so, could not find Java 2 Runtime Environment.)

Posted on 2004-09-29
22
Medium Priority
?
1,719 Views
Last Modified: 2008-01-09
Hello experts,
I have a problem with jar utility as follows:
OS: RedHat
Originally, I've got jar in /usr/bin and this is an old version which didn't let me run update option on existing .jar file.
Hence, I copied a newer version of jar to that folder (/usr/bin)
However, after copy, when I run jar comment, it gave me the error
Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.

Could you please give me some hint to solve this prob.?
Thanks,
Do
0
Comment
Question by:dttai
  • 7
  • 5
  • 4
  • +2
22 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 12177582
You need to (re)install Java
0
 
LVL 35

Expert Comment

by:girionis
ID: 12177584
You need to set the LD_LIBRARY_PATH.

Try adding the <jdk installation folder>/jre/lib/i386 (or i586) to your LD_LIBRARY_PATH
0
 
LVL 92

Expert Comment

by:objects
ID: 12177587
check that LD_LIBRARY_PATH includes directory containing java shared libs
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:Giant2
ID: 12177604
Maybe you have a JDK installed different from the Jar utility you use.
0
 

Author Comment

by:dttai
ID: 12177657
hello all,
before that copy occurs, I have Java running fine on my machine.
In fact, I copy the jar file from my Java installation foder to /usr/bin.
I'll try to add the java shared libs to LD_LIB first (still wondering why the shared libs weren't included, but java still did fine on my machine before though).
Will let you all know.
Thanks,
Do
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12177670
Ok, but when you type:
java -version
you obtain the version from you copy the jar utilities?
0
 
LVL 35

Expert Comment

by:girionis
ID: 12177672
What jar file is that?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12177680
Please post output of

echo $PATH
0
 

Author Comment

by:dttai
ID: 12177707
hello,
I've already added <jdk installation folder>/jre/lib/i386 (as girionis suggested) to my LD_LIBRARY_PATH and it still didn't work.
@Giant2: I am not following your suggestion :).
@CEHJ: I guess reinstalling will solve the problem. Anyway, I am just trying to at least understand why things've gone wrong first :).
Thanks,
Do
0
 

Author Comment

by:dttai
ID: 12177730
@Giant2: yeah, when typing java -version -> i got the java installation dir where I copied the jar util to /usr/bin
@girionis: sorry for a typo on my second message. I meant, the jar util
@CEHJ, here is my PATH:
/usr/local/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/bin:/usr/bin/X11:/etc:/usr/etc:/usr/ccs/bin:/usr/sbin:/opt/java1.4/bin:/opt/TWWfsw/bin

Please note that Java is installed in /opt/java1.4/bin
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12177753
>>
Originally, I've got jar in /usr/bin and this is an old version which didn't let me run update option on existing .jar file.
>>

What versions don't allow this? - i can't remember one

>>
Hence, I copied a newer version of jar to that folder (/usr/bin)
>>

You probably broke the module dependencies by doing so
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12177757
>when typing java -version -> i got the java installation dir where I copied the jar util to /usr/bin

java -version don't answer with a directory, but with a version number. You must check this number.
0
 

Author Comment

by:dttai
ID: 12177778
@Giant2,
it is 1.4.2_04
@CEHJ,
the original Jar util complained when I use option u in my command. Sun website said that jar util included from JDK 1.2 and above would support that option, so my guess: the original jar util was pretty old :).
>>
You probably broke the module dependencies by doing so
>>
if I reinstall Java, would it solve the problem??
0
 
LVL 92

Expert Comment

by:objects
ID: 12177785
what directory is libjava.so in?
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12177791
>if I reinstall Java, would it solve the problem??
use the rpm to uninstall.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12177799
>>if I reinstall Java, would it solve the problem??

Yes should do , but i would uninstall first rather than attempt to install over the top
0
 

Author Comment

by:dttai
ID: 12177802
@objects
libjava.so is in: <jdk installation folder>/jre/lib/i386
0
 
LVL 35

Expert Comment

by:girionis
ID: 12177828
What is the output of this:

echo $LD_LIBRARY_PATH
0
 

Author Comment

by:dttai
ID: 12177845
@girionis:
/opt/java1.4/jre/lib/i386
The rest is just my database stuff, should be irrelevant.
Thanks,
Do
P/S: it's late on the east side now. If you have any more requests, I will respond around noon. G' night to everyone.
0
 
LVL 35

Expert Comment

by:girionis
ID: 12177880
What kind of jar file is that? Is it a runtime jar? If yes then you are better off reinstalling a new varsion of java. In any case, it is always advisable to do a fresh install rather than just copy/paste jar files.
0
 

Author Comment

by:dttai
ID: 12184095
Thanks everyone,
I reinstall Java and it seems to work just fine.
Do
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12184107
8-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

971 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