Solved

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

Posted on 2004-09-29
22
1,697 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
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
servlet requestdispatcher include and forward differences 1 39
servlet example issue 6 46
hibernate example using maven 12 57
Is there a simpler dropbox system? 10 34
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

860 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