Results 1 to 5 of 5

Thread: 10.04 LTS - problem with Jar

  1. #1
    Join Date
    Sep 2011
    Beans
    9

    10.04 LTS - problem with Jar

    I wlould like to request some help from the experts.

    I am relatively new in using ubuntu, although I have sucesfully installed java

    Code:
     java -version
    java version "1.6.0_24"
    OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~10.04.2)
    OpenJDK Server VM (build 20.0-b12, mixed mode)
    I can not create .jar files from the java class using the following command
    Code:
      jar cf test.jar /tmp/test.class 
    The program 'jar' can be found in the following packages:
     * openjdk-6-jdk
     * fastjar
     * gcj-4.4-jdk
     * gcj-4.3
    Try: sudo apt-get install <selected package>
    any suggestions??

  2. #2
    Join Date
    Nov 2006
    Location
    The green
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: 10.04 LTS - problem with Jar

    Did you install the package 'openjdk-6-jdk'? It seems you have only installed the JRE (openjdk-6-jre).
    Code:
    sudo apt-get install openjdk-6-jdk
    #495467 - #35304

    <=> Problem solved? Mark thread solved

  3. #3
    Join Date
    Sep 2011
    Beans
    9

    Re: 10.04 LTS - problem with Jar

    Dear omeomi,

    Thanks for your reply, but I have already installed JDK via the following package

    jdk-6u38-linux-i586.bin

    Inside /usr/lib/jvm/jdk1.6.0_38/bin there is a jar executable file.

    Do I really need install openjdk on top??

  4. #4
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,481

    Re: 10.04 LTS - problem with Jar

    Jerry M, there is difference between *running* a jar, and *creating* a jar. You want to create a jar, right? If so, install the advised package.

    Then create a jar, and see that it works.

    If you want like it, you can remove the package again

  5. #5
    Join Date
    Sep 2011
    Beans
    9

    Re: 10.04 LTS - problem with Jar

    Sanderj thanks for your reply, but my point of view is not only to have something working but to understand why that is the right thing to do.
    So is this a difference between oracle JDK and Open JDK (where only OpenJDK offers the capability to create .jar)??

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •