This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a jar file from the command line

 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a swing based application in a package called moiveJava2. My moment interval class, WindowGUIMI, has one main method which instantiates the rest of the application from another class called WindowGUI.
I have created a manifest file called MovieJava2.MF which has one line equal to:
Main-Class: WindowGUIMI //plus a carriage return
My dos command lines thus far have been:
C:\java_programs\MovieJava>jar cvf MovieJava2.jar movieJava2\*
C:\java_programs\MovieJava>jar cmf MovieJava2.MF MovieJava2.jar movieJava2\*.class
When I double click on the jar file I get a JVM Launcher error dialog which says: "Could not find the main class. Program will exit".
What have I done wrong here?
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about trying to change your Main class def'n to:
Main-Class: moiveJava2.WindowGUIMI //plus carriage return
so it specifies the fully qualified class name of your application?
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jessica,
You are the best! That worked. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic