Find the answer to your Linux question:
Results 1 to 7 of 7
Hi guys, i am new to the Unix/Linux OS. as part of my uni course, i have to complete a Unix Programming module. I been tasked to develop a simple ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Posts
    9

    How to unpack JAR files in Linux ?


    Hi guys, i am new to the Unix/Linux OS. as part of my uni course, i have to complete a Unix Programming module. I been tasked to develop a simple shell script that uses some java programs that has been provided by my lecturer to aid in my assignment.

    Now i am been trying to upack the jar files. I used jar --help and the help instructed me to use jar -x <nameofjarfiles> as parameters. Upon hitting the keyboard, the terminal didn't not respone and only after i used CRTL-C that it went back to the terminal.

    Could someone help me out in the commands in unpacking the java jar files so that i could use them or instruct me to any pages that contains information of developing of shell scripts using java class files.

    I'm currently using Fedora Core 2.

    regards
    wilson

  2. #2
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512
    It's no difference by using Java in Linux or any other OS.
    Unless it is a java that is not completly Sun Java compatible.

    Just to be sure, you did not capitilize any in your command or options when you tried to extract your .jar file?

  3. #3
    Linux Newbie
    Join Date
    Jul 2004
    Location
    Calcutta, India
    Posts
    220
    same happens with me .. I guess you should install jdk ( Java Development Kit ) first. Not sure though ...

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512
    Did you by any chance install any other version than the Sun Java 1.4.2?

    If you did, remove it and install the one above.
    Me my self have a few bad experiences even with Sun 1.5.x
    But I do know there are a few other as "Kaffe" and so on, remove and install Sun, should be good enough with JRE 1.4.2

  6. #5
    Just Joined!
    Join Date
    Mar 2005
    Posts
    9
    Quote Originally Posted by swemic
    Did you by any chance install any other version than the Sun Java 1.4.2?

    If you did, remove it and install the one above.
    Me my self have a few bad experiences even with Sun 1.5.x
    But I do know there are a few other as "Kaffe" and so on, remove and install Sun, should be good enough with JRE 1.4.2
    okay guys...sorry for the foobar, i didn't install jdk in the first place..i tot checking the java option during fedora installtion will do the trick ..sorry my fault..

    I just installed JDK on my machine, may i know how do i set the class path so that i may call the compliers from wherere i wish ..similar to the windows enviroment..i understand in Windows, you actually set the enviroment variable, so what do i change in Linix so that i can do the same ?

    Oh yeah ...with regards to the JAR files...just open up a file manager, select the jar file, right click to retirve the contents...is suffic..
    regards
    wilson

  7. #6
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512
    To set environment variables in Linux you use the command
    Code:
    export MYVARIABLE=some-content
    And to set system wide used variables
    you just insert your variables in file /etc/profile
    Untill you have rebooted your system you have to do
    source /etc/profile for your newly variables to take affect
    Or if you wish to use user-local variables (which most of the cases is good enough) just insert your variables in
    /home/<userid>/.bash_profile
    These variables and settings will take affect the very next time you loggin

  8. #7
    Just Joined!
    Join Date
    May 2009
    Posts
    1
    Quote Originally Posted by tanweeyang View Post
    Hi guys, i am new to the Unix/Linux OS. as part of my uni course, i have to complete a Unix Programming module. I been tasked to develop a simple shell script that uses some java programs that has been provided by my lecturer to aid in my assignment.

    Now i am been trying to upack the jar files. I used jar --help and the help instructed me to use jar -x <nameofjarfiles> as parameters. Upon hitting the keyboard, the terminal didn't not respone and only after i used CRTL-C that it went back to the terminal.

    Could someone help me out in the commands in unpacking the java jar files so that i could use them or instruct me to any pages that contains information of developing of shell scripts using java class files.

    I'm currently using Fedora Core 2.

    regards
    wilson
    jar xf <jar> will work

Posting Permissions

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