Results 1 to 11 of 11
Like Tree1Likes
  • 1 Post By Norm

Thread: No honey is dripping out of my .jar

  1. #1
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default No honey is dripping out of my .jar

    I followed the steps in Create JAR file in Java & Eclipse | Update JAR file in Java | ViralPatel.net to create a .jar file.

    However, 2-clicking the resulting .jar file does neither diddly nor squat nor anything else of note.

    This is my first Java application. I was hoping it would be like a Windows .exe and "just work," but apparently I'm missing something.

    I extracted the jar to see what was in it. Feeling a bit like Winnie (not Mandela), I was hoping for some honey. Instead, I saw:

    Java Code:
    com (folder)
    META-INF (folder)
    .classpath
    .project
    Buried deep within the "com" folder (following my package structure down) are several *.class files.

    The META-INF folder contains one file, namely "Manifest.MF" which has one lonely line, specifically:

    Java Code:
    Manifest-Version: 1.0
    I'm guessing probably a little more than this is needed?

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

    Default

    The manifest file needs a Main-Class: record.

    No idea how to tell your IDE how to create one.
    blackbird likes this.

  3. #3
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    The manifest file needs a Main-Class: record.

    No idea how to tell your IDE how to create one.
    OK; I'll do a little more digging.

    BTW, is that a solar panel growing out the side of your head, or...???

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

    Default

    a solar panel growing out the side of your head
    Yes, actually it is a bit behind me. Do you recognize the archaic tool I'm holding in my hand?

  5. #5
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Yes, actually it is a bit behind me. Do you recognize the archaic tool I'm holding in my hand?
    I'm guessing it's some sort of haywire turbo-charged weapon for shooting clay pigeons.

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,577
    Rep Power
    25

    Default

    Nothing as interesting as that.

  7. #7
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Nothing as interesting as that.
    Okay, it's a sextant?

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,577
    Rep Power
    25

    Default

    Congratulations. If there were a prize, you'd win it.

  9. #9
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default

    Old Navy, I take it.

  10. #10
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,577
    Rep Power
    25

    Default

    Yes. And also a sailor.

  11. #11
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default

    Which makes three songs come to mind: I'm Your Captain/Closer to Home, Sailing to Philadelphia, and the Wreck of the Edmund Fitzgerald

    Anyway, here is how I finally learned to love the Jar file and stop worrying about ever getting it to execute/run:

    Here are the steps for creating an exucutable/runnable Jar file with Eclipse:

    1) Right-click the project and select Run As -> Run Configurations...

    2) 2-Click "Java Application"

    3) Verify that the correct Project is in the "Project" drop-down

    4) Select the Search button, and then select the class from the list which contaisn the "Main" method (with the String[] args)

    5) Select the "Apply" then "Close" buttons

    6) Note the name of the Configuration file you've created

    7) Select File -> Export -> Runnable Jar File

    8) Select the "Next" button

    9) Verify that the item in the "Launch Configuration" drop-down is the one you created (see step 6)

    10) Give the Jar file a full path and name in the "Export destination" drop-down

    11) Select Finish

    12) Stare in awe and wonderment at the beauty of it all as you 2-click your jar file and see it execute/run

Posting Permissions

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