File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes Executing jar ....... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Executing jar ......." Watch "Executing jar ......." New topic
Author

Executing jar .......

Giorgos gapgaps
Greenhorn

Joined: Dec 11, 2003
Posts: 3
The problem stated as following:
I have a implemented a Main.class file that prints the "Hello World" string.
If i try to run this by issuing the command
cvm Main
then all goes well,
BUT if using the Main.class produce the Main.jar file (jar -cf Main.jar Main) and then try to run it :
cvm -Djava.class.path=Main.jar Main
I get the java.lang.OutOfMemoryError
at java.util.zip.Inflater.inflateBytes([BII)I(Native Method)
at java.util.zip.Inflater.inflate([BII)I(Inflater.java:196)
at java.util.zip.InflaterInputStream.read([BII)I(InflaterInputStream.java:128)
at java.io.DataInputStream.readFully([BII)V(DataInputStream.java:157)
at java.util.jar.JarFile.getBytes(Ljava/util/zip/ZipEntry [B(JarFile.java:286)
at java.util.jar.JarFile.getManifest()Ljava/util/jar/Manifest;(JarFile.java:145)
at sun.misc.Launcher$AppClassLoader.defineClassPrivate(Ljava/lang/String;Lsun/misc/Launcher$ClassContainer Ljava/lang/Class;(Launcher.java:458)
at sun.misc.Launcher$AppClassLoader.access$500(Lsun/misc/Launcher$AppClassLoader;Ljava/lang/String;Lsun/misc/Launcher$ClassContainer Ljava/lang/Class;(Launcher.java:295)
at sun.misc.Launcher$4.run()Ljava/lang/Object;(Launcher.java:492)
at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext Ljava/lang/Object;(AccessController.java:330)
at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction Ljava/lang/Object;(AccessController.java:299)
at sun.misc.Launcher$AppClassLoader.doClassFind(Ljava/lang/String Ljava/lang/Class;(Launcher.java:486)
at sun.misc.Launcher$AppClassLoader.findClass(Ljava/lang/String Ljava/lang/Class;(Launcher.java:517)
at java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;(ClassLoader.java:322)
at sun.misc.Launcher$AppClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;(Launcher.java:349)
at java.lang.ClassLoader.loadClass(Ljava/lang/String Ljava/lang/Class;(ClassLoader.java:278)
at java.lang.ClassLoader.loadClassInternal(Ljava/lang/String Ljava/lang/Class;(ClassLoader.java:338)
Any ideas ??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing jar .......
 
Similar Threads
java.lang.NoClassDefFoundError
running a .class file from inside a jar
Jar File and java.lang.SecurityException.
package javax.servlet.http does not exist
Ant - How to create a runnable jar of jars and classes