• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xxxx.jar seen as xxxx.zip on desktop and won't run

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running a .jar file (as an executable) on my machine (where I run JGrasp with the SDK loaded) I have no problem. When I post the .jar on my intranet server and download it to a machine where I have only the JRE installed, it is seen as a .zip file and gives me the error message "Could not find the main class. Program will exit" when I double click it, even after I change the name from xxxx.zip to xxxx.jar.

I think that the manifest file is correct because the .jar runs ok with double-clicking on the "full java" machine. Any suggestions?
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Open the file with Winzip or some other editor and inspect the manifest file.
Renaming from jar to zip and back shouldn't change the contents of the file.

Have you tried manually entering:
java.exe -jar xxxx.jar

Copy and post the contents of the console with the commandline and the error messages so we can see what's happening.
 
Bill Stanard
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The (working on my machine) manifest file points at MBSGUI as the file with the main method. I used the following command to execute the MBSimulation.jar file:

java.exe -jar MBSimulation.jar

The error thrown is as follows:

java.lang.UnsupportedClassVersionError: MBSGUI (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"

Does this help?

cheers!
Bill
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That error means that the class files are newer than the JVM you're trying to run them on. 49.0 is the version that Tiger (Java 5) produces; any earlier JVM (like version 1.4) will print an error message like this and be unable to load the program.

If you're using Tiger features, you can only run on a Tiger JVM. Alternatively, if you're not, you can compile with the "-source 1.4" command line arguments to javac to produce backward-compatible class files.
 
Bill Stanard
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, folks, both for listening and giving such good advice. Updated the JRE to 1.5 (or is it 5.0?) and all ran beautifully. Had to change the file name from xxxx.zip to xxxx.jar, but that is small cheese. Again, thanks...
cheers!
Bill
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic