Solved

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

Posted on 2004-09-29
22
1,692 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 50 total points
Comment Utility
You need to (re)install Java
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
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
Comment Utility
check that LD_LIBRARY_PATH includes directory containing java shared libs
0
 
LVL 12

Expert Comment

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

Author Comment

by:dttai
Comment Utility
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
Comment Utility
Ok, but when you type:
java -version
you obtain the version from you copy the jar utilities?
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
What jar file is that?
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
Please post output of

echo $PATH
0
 

Author Comment

by:dttai
Comment Utility
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
Comment Utility
@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
Comment Utility
>>
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 12

Expert Comment

by:Giant2
Comment Utility
>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
Comment Utility
@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
Comment Utility
what directory is libjava.so in?
0
 
LVL 12

Expert Comment

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

Expert Comment

by:CEHJ
Comment Utility
>>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
Comment Utility
@objects
libjava.so is in: <jdk installation folder>/jre/lib/i386
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
What is the output of this:

echo $LD_LIBRARY_PATH
0
 

Author Comment

by:dttai
Comment Utility
@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
Comment Utility
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
Comment Utility
Thanks everyone,
I reinstall Java and it seems to work just fine.
Do
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
8-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sumHeights2  challenge 7 75
count8 challlenge 13 84
stringclean challenge 26 53
computer science syllabus 3 52
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

728 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

11 Experts available now in Live!

Get 1:1 Help Now