Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1723
  • Last Modified:

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

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
dttai
Asked:
dttai
  • 7
  • 5
  • 4
  • +2
1 Solution
 
CEHJCommented:
You need to (re)install Java
0
 
girionisCommented:
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
 
objectsCommented:
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!

 
Giant2Commented:
Maybe you have a JDK installed different from the Jar utility you use.
0
 
dttaiAuthor Commented:
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
 
Giant2Commented:
Ok, but when you type:
java -version
you obtain the version from you copy the jar utilities?
0
 
girionisCommented:
What jar file is that?
0
 
CEHJCommented:
Please post output of

echo $PATH
0
 
dttaiAuthor Commented:
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
 
dttaiAuthor Commented:
@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
 
CEHJCommented:
>>
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
 
Giant2Commented:
>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
 
dttaiAuthor Commented:
@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
 
objectsCommented:
what directory is libjava.so in?
0
 
Giant2Commented:
>if I reinstall Java, would it solve the problem??
use the rpm to uninstall.
0
 
CEHJCommented:
>>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
 
dttaiAuthor Commented:
@objects
libjava.so is in: <jdk installation folder>/jre/lib/i386
0
 
girionisCommented:
What is the output of this:

echo $LD_LIBRARY_PATH
0
 
dttaiAuthor Commented:
@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
 
girionisCommented:
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
 
dttaiAuthor Commented:
Thanks everyone,
I reinstall Java and it seems to work just fine.
Do
0
 
CEHJCommented:
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.

  • 7
  • 5
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now