Results 1 to 4 of 4
  1. #1
    krazy is offline Member
    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Default Updating .jar ??

    I have a compiled JAR file, but it has a ton of classes that I don't have the source to. I only have the source code to a single class in the JAR, so I recompiled it (no changes) with javac in cmd prompt. Then I opened the JAR file in WinRAR and deleted the old main_class.class and updated it with my recompiled version.

    Now every single time I start the program it says "could not find the main class: main_class. Program will exit." I am assuming that updating a JAR file with WinRAR doesn't work so are there any other ways to do it? Sorry, I'm pretty experienced with C++ but have never even touched Java.
    Last edited by krazy; 08-17-2011 at 05:13 AM.

  2. #2
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    Check the path to the "main_class.class" file in the jar. It needs to be the same as before -- probably nothing. It's easy to get that wrong.

    Another trick is to rename the extension to '.zip' or add '.zip' to the end, then edit it, then rename back.

  3. #3
    krazy is offline Member
    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Default

    Thanks a lot, I'll try out your advice now.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    I opened the JAR file in WinRAR and deleted the old main_class.class and updated it with my recompiled version.
    Do the terms of the license allow you to do that?

    db

Similar Threads

  1. Updating JTable
    By dewitrydan in forum New To Java
    Replies: 3
    Last Post: 03-31-2011, 10:59 AM
  2. Updating my gui
    By mrx89_7 in forum New To Java
    Replies: 4
    Last Post: 02-09-2011, 06:33 AM
  3. Replies: 1
    Last Post: 09-15-2010, 05:41 AM
  4. Updating my GUI
    By Catkill in forum AWT / Swing
    Replies: 6
    Last Post: 09-01-2009, 06:09 PM
  5. Updating into 2 tables in the DB
    By yuchuang in forum New To Java
    Replies: 2
    Last Post: 05-12-2007, 07:54 AM

Posting Permissions

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