Solved

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

Posted on 2004-09-29
22
1,704 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

696 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