• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar problem

 
Shweta Grewal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49466
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 39
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Rancher
    Posts: 1776
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 49466
    64
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 15369
    40
    Android IntelliJ IDE Java Scala Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    Shweta Grewal
    Ranch Hand
    Posts: 39
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I am using Linux(Centos)
     
    John Jai
    Rancher
    Posts: 1776
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 39
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I get same results when I execute :
    jar
    without anything
     
    Jesper de Jong
    Java Cowboy
    Saloon Keeper
    Pie
    Posts: 15369
    40
    Android IntelliJ IDE Java Scala Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    It sounds like Java is not properly installed on your machine; try to re-install it.
     
    Shweta Grewal
    Ranch Hand
    Posts: 39
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    but commands like
    javac work
     
    Shweta Grewal
    Ranch Hand
    Posts: 39
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 49466
    64
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    If sorting out your PATH cured the problem, you should review your system PATH.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic