Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default Trouble with JAR files

    Hey whats up guys. I've created a good few Java programs, but i never got around to actually exporting them so i could use them without opening eclipse. So i figured i'd give it a shot. Unfortunately, I tried exporting one of my programs as a JAR and upon trying to run the program i got an error message: Failed to load Main-Class manifest attribute from <location where i saved my file> Anybody know whats going on? I could really use some help!

    -MiniatureBeast
    Last edited by MiniatureBeast; 07-17-2011 at 10:04 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default

    To execute a program in a jar file using the java -jar option, the jar file must contain a special file the manifest that contains the name of the starting class on the line starting with: Main-Class:
    Check that your jar file contains that file and the the file has the Main-Class record.

    No idea how to make your IDE create one.

  3. #3
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default

    Thanks, but like you, i have no idea how to do this with my IDE. So anybody else no how to do this with eclipse?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default

    This is a common problem and I remember others posting questions and answers given. Do a Search here.

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2011, 02:54 PM
  2. Creating Jar Files with functioning input files
    By appleLove in forum NetBeans
    Replies: 1
    Last Post: 04-10-2011, 11:37 PM
  3. Trouble compiling java files
    By winterkid09 in forum Java Applets
    Replies: 2
    Last Post: 11-21-2010, 11:25 AM
  4. Replies: 8
    Last Post: 07-30-2010, 06:47 PM
  5. Behaving text files like binary files
    By Farzaneh in forum New To Java
    Replies: 2
    Last Post: 08-27-2008, 04:20 PM

Tags for this Thread

Posting Permissions

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