GELÖST, habe ich esjava.lang.NoClassDefFoundError, aber alle JAR-Dateien vorhanden sind,
ARBEITENich mein erstes richtiges JAVA-Programm gerade abgeschlossen. Es ist ein Programm, mit dem Sie eine .xlsx-Datei öffnen können und das Programm extrahiert Daten aus dieser Datei und zeigt dies in einem textArea.
In Eclipse funktioniert das Programm völlig einwandfrei, aber das exportierte Glas nicht. Sobald das Projekt exportiert ist, öffne ich es in CMD mit java -jar c: // ...... und es öffnet sich gut. Jedoch wenn ich versuche, die Excel-Datei zu öffnen, bekomme ich diesen Fehler:
Also im Grunde eine der benötigten .jar-Dateien im laufenden Betrieb nicht zur Verfügung stehen scheint. Ich glaube jedoch, dass alle benötigten poi-3.9 und xmlbeans verfügbar sind. Siehe hierzu:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="src/xmlbeans-2.3.0.jar"/>
<classpathentry exported="true" kind="lib" path="src/poi-3.9-20121203.jar"/>
<classpathentry exported="true" kind="lib" path="src/poi-examples-3.9-20121203.jar"/>
<classpathentry exported="true" kind="lib" path="src/poi-excelant-3.9-20121203.jar"/>
<classpathentry exported="true" kind="lib" path="src/poi-ooxml-3.9-20121203.jar"/>
<classpathentry exported="true" kind="lib" path="src/poi-ooxml-schemas-3.9-20121203.jar"/>
<classpathentry exported="true" kind="lib" path="src/poi-scratchpad-3.9-20121203.jar"/>
<classpathentry exported="true" kind="lib" path="src/log4j-1.2.13.jar"/>
<classpathentry exported="true" kind="lib" path="src/junit-3.8.1.jar"/>
<classpathentry exported="true" kind="lib" path="src/commons-logging-1.1.jar"/>
<classpathentry exported="true" kind="lib" path="commons-collections4-4.1-javadoc.jar"/>
<classpathentry exported="true" kind="lib" path="commons-collections4-4.1.jar"/>
<classpathentry exported="true" kind="lib" path="src/commons-codec-1.5.jar"/>
<classpathentry exported="true" kind="lib" path="poi-ooxml-3.9.jar"/>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.4.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cssparser-0.9.20.jar"/>
<classpathentry exported="true" kind="lib" path="lib/htmlunit-2.23.jar"/>
<classpathentry exported="true" kind="lib" path="lib/htmlunit-core-js-2.23.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient-4.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.4.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpmime-4.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jetty-io-9.2.18.v20160721.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jetty-util-9.2.18.v20160721.jar"/>
<classpathentry exported="true" kind="lib" path="lib/neko-htmlunit-2.23.jar"/>
<classpathentry exported="true" kind="lib" path="lib/sac-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/serializer-2.7.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/websocket-api-9.2.18.v20160721.jar"/>
<classpathentry exported="true" kind="lib" path="lib/websocket-client-9.2.18.v20160721.jar"/>
<classpathentry exported="true" kind="lib" path="lib/websocket-common-9.2.18.v20160721.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xalan-2.7.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.11.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis-1.4.01.jar"/>
<classpathentry exported="true" kind="lib" path="src/jsoup-1.10.1.jar"/>
<classpathentry exported="true" kind="lib" path="src/dom4j-1.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="src/selenium-server-standalone-3.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="src/stax-api-1.0.1.jar"/>
<classpathentry kind="lib" path="src/poi-ooxml-3.11.jar"/>
<classpathentry exported="true" kind="lib" path="src/xbean-2.0.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Siehe auch meine Bestellung und Exporttab in den Build-Pfad-Konfigurationen.
bin ich etwas fehlt? Jede Hilfe wird sehr geschätzt!
EDIT: Ich habe einige Änderungen vorgenommen und alle notwendigen Gläser sind in der lib/Ordner meines Projekts. Wenn ich jar exportiere und den jar-Inhalt mit jar tf "location.jar" betrachte. Ich bekomme Folgendes. Ich glaube also, dass alles gut exportiert wird. Irgendwelche Vorschläge, was schief gehen könnte, weil ich immer denselben Fehler bekomme.
Warum haben Sie Bibliotheken in 'src'? – MozenRath
Versuchen Sie, die JAR-Datei mit dem Archivierer zu öffnen, und überprüfen Sie, ob Sie die JAR-Dateien der Bibliotheken im lib-Ordner finden können, um sicher zu sein, dass sie korrekt gepackt sind. – sphinks
immer noch 2 Schecks in abhängigen JAR-Dateien fehlen, so überprüfen Sie einfach alle und dann versuchen, könnte Ihnen helfen – NarendraR