Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: about making .class into .jar

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default about making .class into .jar

    okey i got a problem when i try making jar with winrar ( archiving the folder where the .class folders are and then changing the xxx.zip into xxx.jar and then clicking ok it makes a .jar file BUT when i try open it it says that its corrupted/invalid...) so how i do it right so i wont get that ''corrupted/invalid error'' ?

    iv tried to write ''jar xt '' etc into cmd and it wont find any... i got newes jdk so the problem cant be that :/

    so any ideas how to make it?


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: about making .class into .jar

    Ok, so if it is an executable jar, do you have a manifest? That should not give a corrupted/invalid error but it would be a reason as to why it wouldnt work. I'm not sure what would give you a corrupted/invalid error as if it could not be executed, I would assume it would take it as a non-executable jar.

    Attempt to open the jar file after you change it from a zip to a jar. You can do this without changing it back to a zip (simply right click and choose Open With..., choose winRar, and uncheck "Always use the selected program to open this kind of file"). Once you have that open, have a look at the class files inside. Are they all there? Are any of their sizes 0?

    If everything appears good, I am unsure where to immediately go from there.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: about making .class into .jar

    Quote Originally Posted by sibbe View Post
    iv tried to write ''jar xt '' etc into cmd and it wont find any... i got newes jdk so the problem cant be that
    You must add the jdk to the Path. See Java Installation Notes

  4. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: about making .class into .jar

    The manifest file is important.

    This link should help also - Creating a JAR File

    What IDE do you use?

    Eclipse makes jar files really easy
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  5. #5
    Junior Member
    Join Date
    Oct 2010
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: about making .class into .jar

    im using eclipse but no idea what plug ins i need etc
    i had already set the path and still wont work -.-
    Last edited by sibbe; October 11th, 2010 at 11:04 AM.

  6. #6
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: about making .class into .jar

    Last edited by Darryl.Burke; October 11th, 2010 at 12:59 PM. Reason: underlined the link

  7. #7
    Junior Member
    Join Date
    Oct 2010
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: about making .class into .jar

    bumb! : /
    mtsmtsmtsmtsmts

  8. #8
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: about making .class into .jar

    Both threads bumped. This one needs to learn forum etiquette.

    db

Similar Threads

  1. Making a Craps game.
    By SOK in forum Object Oriented Programming
    Replies: 1
    Last Post: March 6th, 2010, 08:23 PM
  2. making a sentence proper
    By dvsumosize in forum Algorithms & Recursion
    Replies: 5
    Last Post: February 3rd, 2010, 11:01 AM
  3. ArrayList and making a Menu
    By Silver in forum Collections and Generics
    Replies: 2
    Last Post: January 28th, 2010, 03:29 AM
  4. Need help making program
    By ixjaybeexi in forum Collections and Generics
    Replies: 5
    Last Post: December 6th, 2009, 11:36 PM
  5. Digital map application with Java GUI
    By donjuan in forum AWT / Java Swing
    Replies: 3
    Last Post: May 15th, 2009, 03:32 AM