J'ai écrit un petit projet dans Eclipse qui fonctionne parfaitement dans l'EDI. Ensuite, j'ai construit un fichier .jar exécutable via Eclipse (qui devrait inclure toutes les bibliothèques de dépendances dans le fichier jar lui-même).Lors de l'exécution de JAR, obtenez ExceptionInInitializerError: version.properties non trouvée
J'utilise 3 bibliothèque dans mon projet:
- derby.jar
- qtjambi-4.7.1.jar
- qtjambi-win32-msvc2008-4.7.1.jar
Ensuite, j'utilise cette commande (dans Windows):
java -jar prova.jar
Et Je reçois ceci:
Connected to database
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:58)
Caused by: java.lang.ExceptionInInitializerError: version.properties not found!
at com.trolltech.qt.Utilities.<clinit>(Unknown Source)
at com.trolltech.qt.QtJambi_LibraryInitializer.<clinit>(Unknown Source)
at com.trolltech.qt.QtJambiObject.<clinit>(Unknown Source)
at WAAAGH.main(WAAAGH.java:52)
... 5 more
Comme vous pouvez le voir le derby.jar fonctionne comme prévu (« Connecté à la base de données »), mais il y a une erreur avec Qt Jambi-que je ne comprends pas. Une idée?
EDIT: WAAAGH est la classe qui contient la méthode principale, la ligne 52 consiste à:
QApplication.initialize(args);
WAAAGH est-il un cours? – Maverik
Oui, c'est la classe qui contient la méthode principale. À la ligne 52, j'essaie de commencer qt jambi – Alex
Avez-vous vérifié que vous avez le fichier 'version.properties' à l'intérieur de ces pots qt-jambi? –