aspose file tools*
The moose likes Beginning Java and the fly likes jar problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jar problem" Watch "jar problem" New topic
Author

jar problem

Shweta Grewal
Ranch Hand

Joined: Apr 03, 2012
Posts: 39
I am trying to create a jar. But when I try to run the jar command following errors occur:
Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.
I have read posts from people having same problem but couldnot solve the error.Please help.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36514
    
  16
Please supply more details, otherwise we can’t help.
  • What command are you using?
  • What are the contents of the .jar’s manifest file?
  • What happens when you execute java -version and javac -version from the command line?
  • Tell us the full error message, using copy-and-paste.
  • Shweta Grewal
    Ranch Hand

    Joined: Apr 03, 2012
    Posts: 39
    command : jar cf jar-file input-files
    java -version: java version "1.6.0_20"
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
    The error message I gave in my first post is the full error message
    John Jai
    Bartender

    Joined: May 31, 2011
    Posts: 1776
    Shweta Grewal wrote:Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

    Is the machine you try a 64-bit?
    Campbell Ritchie
    Sheriff

    Joined: Oct 13, 2005
    Posts: 36514
        
      16
    It must be a 64 bit machine, otherwise he would never have installed a 64 bit JVM.

    Please give the exact command you are using to create the .jar, not the generic one copied from the documentation page.
    Jesper de Jong
    Java Cowboy
    Saloon Keeper

    Joined: Aug 16, 2005
    Posts: 13875
        
      10

    What operating system are you using? Is it a Unix-like operating system (a Linux distribution, or Mac OS X)?

    About 64-bit: For your own Java software, it doesn't matter if the machine is 32-bit or 64-bit. You do not need to do anything special to make your Java program run on a 32-bit or 64-bit machine.


    Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
    Scala Notes - My blog about Scala
    Shweta Grewal
    Ranch Hand

    Joined: Apr 03, 2012
    Posts: 39
    I am using Linux(Centos)
    John Jai
    Bartender

    Joined: May 31, 2011
    Posts: 1776
    Campbell Ritchie wrote:It must be a 64 bit machine, otherwise he would never have installed a 64 bit JVM.

    I wrongly thought running 64 bit JVM on a 32 bit might create issues.
    Shweta Grewal
    Ranch Hand

    Joined: Apr 03, 2012
    Posts: 39
    I get same results when I execute :
    jar
    without anything
    Jesper de Jong
    Java Cowboy
    Saloon Keeper

    Joined: Aug 16, 2005
    Posts: 13875
        
      10

    It sounds like Java is not properly installed on your machine; try to re-install it.
    Shweta Grewal
    Ranch Hand

    Joined: Apr 03, 2012
    Posts: 39
    but commands like
    javac work
    Shweta Grewal
    Ranch Hand

    Joined: Apr 03, 2012
    Posts: 39
    It works.
    I gave the full path of jar command instead of writing jar I write $JAVA_HOME/bin/jar
    Thanks all for your help
    Campbell Ritchie
    Sheriff

    Joined: Oct 13, 2005
    Posts: 36514
        
      16
    If sorting out your PATH cured the problem, you should review your system PATH.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: jar problem
     
    Similar Threads
    Problem in creating executable jar (Eclipse)
    use jar file in jsp
    getting an error while executing jar file
    oracle.jdbc.xa.OracleXid
    problem in creating advance installer