• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Java Executable file help?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hava created a jar file i can run it from my computer doing the following

java -jar filename.jar

But this same program when I click it on a windows machine it does not work saying it cant find main is that a normal behavior.

Note the windows XP machine has only JRE

Also I have only one class and the main method is inside of it.
in the manifest line I just write the name of my class.
thanks
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Your manifest file should be something like this.


Main-Class: MyClass



and make sure that the text file(Manifest.txt) must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return

cheers,
Shankar.
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to associate the .jar extension with the java (or, more likely, the javaw) command.
 
reply
    Bookmark Topic Watch Topic
  • New Topic