hello i want to open a jar file.but whenever i try to do it i get this message:
what can i do? i have both jre and jdk installedQuote:
Java Virtual Machine Launcher
A Java Exception has occurred.
Printable View
hello i want to open a jar file.but whenever i try to do it i get this message:
what can i do? i have both jre and jdk installedQuote:
Java Virtual Machine Launcher
A Java Exception has occurred.
Have you tried using the java -jar command in a command prompt to see if you get more information?
Opening a jar file does not have anything with JVM.
Do you want to execute a jar file? Please post the error message.
Hey, I have this same problem. I sent my freshly compiled program to my buddy on win7 after trying to open it myself to see if it works on his pc. It didn't work on my girlfriends either. He told me he had this same message box pop up
the window header is Java Virtual Machine Launcher
a java exception has occured
For me and my girlfriend 'on Vista' we get the cmd prompt for a split second.
There is this error in Eclipes. The serializable class VR does not declare a static final serialVersionUID field of type long.
After I spent a really long time looking for ways to fix this I couldn't. I also saw on some threads which say to ignore it so I decided to post for help here.
Thanks!
I am quite new to this.
Can you get the full text of the error message and post it here.
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
I double clicked the .jar file I compiled using Eclipes and the command prompt just opens and closes, displaying nothing. Same for anything else I make.
After doing java -jar SomeSimpleThing.jar it just says this:
Error: Invalid or corrupt jarfile SomeSampleThing.jar
Has this jar file every worked?Quote:
Error: Invalid or corrupt jarfile
Try opening it in a zip file utility to see if the contents are displayable and readable.
Yeah, everything looks like it should.
It runs fine in Eclipes but doesn't when I export it and click the .jar
I'll continue to troubleshoot and post if I get it working.
Can you copy the contents of the command prompt window from when you execute the java -jar command and post it here
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\JIM>java -jar SomeSampleThing.jar
no main manifest attribute, in SomeSampleThing.jar
C:\Users\JIM>java -jar SomeSampleThing.jar
no main manifest attribute, in SomeSampleThing.jar
C:\Users\JIM>
Code:Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\JIM>java -jar SomeSampleThing.jar
no main manifest attribute, in SomeSampleThing.jar
C:\Users\JIM>java -jar SomeSampleThing.jar
no main manifest attribute, in SomeSampleThing.jar
C:\Users\JIM>java -jar
Error: -jar requires jar file specification
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for m
ore details.
C:\Users\JIM>
Does your jar file have a correct manifest file?Quote:
no main manifest attribute, in SomeSampleThing.jar
It should. I compiled it again with Eclipes, then overwrite the previous .jar file and then ran it using cmd prompt.
If not how would I tell? It says inside the manifest file: Manifest-Version: 1.0
If it ran then I don't understand what your problem is.Quote:
then ran it using cmd prompt.