Solved

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

Posted on 2004-09-29
22
1,698 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
[X]
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
  • 7
  • 5
  • 4
  • +2
22 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 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
Technology Partners: 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

749 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