• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jarsigner Error

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

i am no programmer, i am a mere systems admin and iam new to JAVA so bear with me

I have been trying to solve this problem all day yesterday but with no luck , so your help is greatly appreciated

the JAVA APPLET certificate is due to expire on our webserver, we bought the certificate and applied it fine until the last step in which we need to sign the JAR file with the new certificate using the Jarsigner

when typing the following command

$sudo jarsigner jarfile keystore Alias

i get the following error

Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.

for some reason the jarsigner can not find the the JRE, or that is what i think. However, i am not sure how to solve this problem i tried setting up the environment but with no luck, can you pelase help

below are my system info:

REDHAT 5.5
Linux 2.6.18-274.el5 #1 SMP Fri Jul 8 17:36:59 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

java version "1.4.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_02-b02)
Java HotSpot(TM) Client VM (build 1.4.0_02-b02, mixed mode)

$ which java
/usr/java/j2sdk1.4.0_02/bin/java

$ which javac
/usr/java/j2sdk1.4.0_02/bin/javac

The /home/<user>/.bash_profile file is as follows

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/X11R6/bin:/usr/java/j2sdk1.4.0_02/bin

export PATH

Thanks


 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should set the JAVA_HOME variable to point to the JRE or JDK. The correct value is probably /usr/java/j2sdk1.4.0_02.
 
H Houly
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You should set the JAVA_HOME variable to point to the JRE or JDK. The correct value is probably /usr/java/j2sdk1.4.0_02.



Hi Ulf

thank you for your reply

can you please advice on how todo that?

is thsi correct?

export JAVA_HOME=/usr/java/j2sdk1.4.0_02
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it work? If not, try doing it analogous to PATH.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
H Houly, please BeForthrightWhenCrossPostingToOtherSites

http://www.java-forums.org/java-applets/47799-jarsiner-error-error-could-not-find-libjava-so.html
 
H Houly
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:H Houly, please BeForthrightWhenCrossPostingToOtherSites

http://www.java-forums.org/java-applets/47799-jarsiner-error-error-could-not-find-libjava-so.html



Am I supposed to mention that i have posted in other forums!!!??

when i find the solution i was going to post it in both posts

 
H Houly
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Does it work? If not, try doing it analogous to PATH.



Hi Ulf

i did: $export JAVA_HOME=/usr/java/j2sdk1.4.0_02

but did not work,

what do you mean by (try doing it analogous to PATH)

Thanks
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

H Houly wrote:but did not work,


What do you mean by that? What exactly did you do; did you get an error message? What was the error message? (Note: You're not supposed to type the "$" in front of "export").
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're running the jarsigner command as root using sudo, not running it as yourself; that means your environment is meaningless, and it's root's environment that matters. The jarsigner that you get on your path is not necessarily the one that root gets; nor is the sudo shell going to inherit things like JAVA_HOME from your environment. All of the environment info you've reported to us so far is pretty much meaningless because it's not in effect for the command you eventually run.

Try sudo which jarsigner, sudo java -version, and sudo printenv JAVA_HOME. That should give you an idea of what you're working with. If you still don't know what to do, tell us what those commands report and we'll try to help.

Alternatively, to make it work without knowing what was going wrong, just set JAVA_HOME in root's environment and force the right version of jarsigner:

 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

H Houly wrote: . . . Am I supposed to mention that i have posted in other forums!!!?? . . .

Yes. People on both fora need to know there might be a solution elsewhere.

And welcome to the Ranch

Try echo $PATH and export PATH=/usr/java.jdk1.4.2.0_02/bin:$PATH at a terminal, and see whether that helps. [Or "j2sdk" instead of "jdk", wherever your Java™ installation lives.]
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:
Try echo $PATH and export PATH=/usr/java.jdk1.4.2.0_02/bin:$PATH at a terminal, and see whether that helps.



Or don't; please see my answer above.
 
Campbell Ritchie
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think we are trying different ways of doing the same thing.

I'll vanish before I confuse him any more.
 
H Houly
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ernest

it worked perfectly

your help is greatly appreciated.

I shoudl have known better that the reason is me using the Sudo

Campbell, thank you for your help as well

i am a forum newbie , next time i will make sure to post the link if i post in a different forum

Thanks all
 
Campbell Ritchie
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done getting it to work
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

H Houly wrote:

Darryl Burke wrote:H Houly, please BeForthrightWhenCrossPostingToOtherSites

http://www.java-forums.org/java-applets/47799-jarsiner-error-error-could-not-find-libjava-so.html



Am I supposed to mention that i have posted in other forums!!!??

when i find the solution i was going to post it in both posts



H Houly wrote:Hi Ernest

it worked perfectly



Still waiting to see that solution appear on the other forum.
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic