|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jan 2006
Messaggi: 326
|
[JAVA] Creare JAR con Eclipse
Salve a tutti,
sto provando a creare un file JAR con Eclipse. Il procedimento che utilizzo è quello di fare Export-Jar file e seguo tutte le istruzioni. La classe in cui ho il main() è model.java...e quindi il mio file Manifest sarà Manifest-Version: 1.0 Main-Class: model Ma quando vado ad eseguire il JAR mi esce un messaggio di errore che dice: "Could not find the main class:model. Program will exit." Come maii??? |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Apr 2002
Città: Palermo
Messaggi: 4913
|
Nel file manifest devi mettere il nome della classe corretto, immagino si chiami Model.java
Inoltre ti consiglio di mettere sempre le tue classi in un package.
__________________
Sun Certified Java Programmer - Sun Certified Web Component Developer - Sun Certified Business Component Developer |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: May 2005
Città: Roma
Messaggi: 7938
|
click destro sul progetto "Export Runnable Jar", segui il wizard ed è fatto.
__________________
My gaming placement |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Jan 2006
Messaggi: 326
|
Non funziona in nessuno dei 2 modi!
Nel manifest il nome della classe è corretto! Ma mi da ugualmente lo stesso errore "Could not find the main class:model. Program will exit". Se invece provo a fare "Export Runnable JAR" , me lo crea ma quando ci clicco sopra non succede niente. |
|
|
|
|
|
#5 | |
|
Senior Member
Iscritto dal: May 2005
Città: Roma
Messaggi: 7938
|
Quote:
java -jar nomefile.jar e vedi che errore ti dà
__________________
My gaming placement |
|
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Jan 2006
Messaggi: 326
|
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/opengl/GL
EventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) 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$000(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) Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLEventListener 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) ... 12 more Could not find the main class: Model. Program will exit. |
|
|
|
|
|
#7 |
|
Senior Member
Iscritto dal: Jan 2006
Messaggi: 326
|
Invece con il Runnable JAR l'errore è questo
Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa der.java:56) Caused by: java.lang.UnsatisfiedLinkError: no nativewindow_win32 in java.library .path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoad erBase.java:218) at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.ja va:51) at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNIL ibLoaderBase.java:81) at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNIL ibLoaderBase.java:106) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.j ava:146) at com.jogamp.nativewindow.impl.NWJNILibLoader.access$000(NWJNILibLoader .java:36) at com.jogamp.nativewindow.impl.NWJNILibLoader$1.run(NWJNILibLoader.java :41) at java.security.AccessController.doPrivileged(Native Method) at com.jogamp.nativewindow.impl.NWJNILibLoader.loadNativeWindow(NWJNILib Loader.java:39) at com.jogamp.nativewindow.impl.windows.GDI.initSingleton(GDI.java:207) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.jogamp.common.util.ReflectionUtil.callMethod(ReflectionUtil.java: 267) at com.jogamp.common.util.ReflectionUtil.callStaticMethod(ReflectionUtil .java:289) at javax.media.nativewindow.NativeWindowFactory.initNativeImpl(NativeWin dowFactory.java:134) at javax.media.nativewindow.NativeWindowFactory.initSingleton(NativeWind owFactory.java:215) at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile. java:1090) at javax.media.opengl.GLProfile.access$000(GLProfile.java:66) at javax.media.opengl.GLProfile$1.run(GLProfile.java:112) at java.security.AccessController.doPrivileged(Native Method) at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:110) at javax.media.opengl.GLProfile.validateInitialization(GLProfile.java:13 45) at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1497) at javax.media.opengl.GLProfile.get(GLProfile.java:549) at javax.media.opengl.GLProfile.getDefault(GLProfile.java:447) at javax.media.opengl.GLProfile.getDefault(GLProfile.java:453) at Model.main(Model.java:139) ... 5 more |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:30.




















