Results 1 to 7 of 7
  1. #1
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default Jar File Manifest

    1) Am I supposed to create a manifest file before I compile a jar file or is it the other way around?

    2) when I compile my Jar file using command prompt, there is compliation error but when I run it in netbeans it works. Please refer to attachment

    3) How am I supposed to pass arguments in the JarRunner class?
    The JarRunner Class (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
    There is no prompt for user input.:mad:

    public JarClassLoader(URL url) {
    super(new URL[] { url });
    this.url = url;
    }

    public static void main(String[] args) {
    if (args.length < 1) {
    usage();
    }
    URL url = null;
    try {
    url = new URL(args[0]);
    } catch (MalformedURLException e) {
    fatal("Invalid URL: " + args[0]);
    }
    // Create the class loader for the application jar file
    JarClassLoader cl = new JarClassLoader(url);
    Attached Thumbnails Attached Thumbnails Jar File Manifest-help.jpg  

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    manifest file can be created right from txt file with right click -> Create -> newfile.txt ) just change txt to *.mf exten.
    But your manifest should contain correct path to your main class so add it manually. some like a mainpackage.mainclass...
    pack jar file and create web-inf package and place your manifest to it. then place web-inf right to your jar file )
    I know it seems too manually but it is quite useful )))

  3. #3
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default

    what is web-inf package? How do I place it "right to" my jar file? I even have problems opening it. If I extract it, I cant even edit the .MF extension.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    When you build the application on NetBeans did you check the dist folder in the project folder?

  5. #5
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Quote Originally Posted by hitmen View Post
    what is web-inf package? How do I place it "right to" my jar file? I even have problems opening it. If I extract it, I cant even edit the .MF extension.

    WinZip, WInRAR and so on )))

  6. #6
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    what is web-inf package?
    It is a simple system folder )

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Replies: 0
    Last Post: 02-11-2009, 10:53 AM
  2. To open an image file such as Jpeg file using JAva Program
    By itmani2020 in forum Advanced Java
    Replies: 10
    Last Post: 07-11-2008, 10:57 AM
  3. Replies: 7
    Last Post: 05-23-2008, 04:46 AM
  4. Manifest file in executable jars
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-15-2007, 09:16 PM

Posting Permissions

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