Wie baue ich ein Jar File mit Netbeans?

Status
Nicht offen für weitere Antworten.

lukasgo

Mitglied
Hallo,

Ich werfe langsam die Nerven weg, ich versuche schon seit längerem verzweifelt ein JarFile aus einem NetBeans Project zu bauen, nur lässt sich das Jar File nicht starten.
Ich habe selbstverständlich bei den Project-Properties die Klasse die ausgeführt werden soll als Main-Class eingetragen.

Hier mein Manifest
Code:
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Class-Path: dist/lib/Console2 dist/lib/gnujaxp dist/lib/iText-2.1.3 dist/lib/jcommon-1.0.15 dist/lib/jfreechart-1.0.12 dist/lib/jfreechart-1.0.12-experimental dist/lib/jfreechart-1.0.12-swt dist/lib/junit dist/lib/jxl dist/lib/servlet dist/lib/swtgraphics2d
Main-Class: gui

Ich sag gleich dazu das ich zu Beginn geglaubt hab das Netbeans das Manifest automatisch erstellt, allerdings hat es auch keine Änderung gegeben als ich dann selbst Hand an das Manifest gelegt hab.

Des weiteren hab ich in meinem Programm einige Icons im png Format, würde es reichen wenn diese PNG Files im selben Ordner mit der JAR Datei liegen?

Bitte um Hilfe!

mfg
lukasgo
 

MarcB

Bekanntes Mitglied
Netbeans baut automatisch ein Jar-File mit entsprechendem Manifest, bei Klick auf "Clean&Build".
Dein Problem kann damit zusammen hängen, dass deine Main Class "gui" (Klassennamen schreibt man groß!) nicht in einem Package steckt (oder du es nicht angegeben hast).

Warum steht im Classpath eigentlich "dist/lib/..." statt "lib/..."? Das Jar-File liegt doch auch im dist Ordner?!

Des weiteren hab ich in meinem Programm einige Icons im png Format, würde es reichen wenn diese PNG Files im selben Ordner mit der JAR Datei liegen?

Das kommt drauf an, wie du sie im Code lädst. Icons packt man meistens einfach mit ins Jar.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
J Java-File Import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
J Javac File generieren Eclipse oder IntellJ (JNI) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
C if statt while nach export Runnable Jar File IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
G Jar-File innerhalb und außerhalb IDE IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
L NetBeans JTable wird nicht mit Daten aus File abgefüllt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
O Eclipse Jar File innerhalb meines Runnable Jar-Files nutzen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
O Eclipse Referenced Libraries meiner Anwendung bei Jar-File-Erstellung nicht vorhanden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
N [ANT] Invalid signature file digest for Manifest main attributes IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
R Eclipse ANT Build-File ausführen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
A Checkstyle + Netbeans + cfg File IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
El_Lobo Eclipse LAF jar file einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
W Eclipse Splash Screen in Runnable JAR file IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
S Exportiertes Jar-File geht nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 24
A Eclipse: Probleme mit Erstellen eines jar file IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
E Eclipse Jar-File [,,Could not find the main class - program will exit"] IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 25
R Eclipse Class File Editor IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 11
L Property File soll neben war-file liegen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
D NetBeans Keine Resourcen in erzeugtem Jar-File IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse Runnable JAR File mit referenzierten Libraries IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
M ecore-file mit eclipseuml IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
Sonecc Eclipse: File System import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
J class-File-Splitter-Tool gesucht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
I Eclipse Sourcecode in Word file kopieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
H eclipse: wie benötigte Jar-file einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
Ä resource is out of sync with the file system ? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
Silas89 resource is out of sync with the file system IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
M Eclipse-Plugin: Properties-File IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
B Eclipse - File Changed IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
padde479 jar-File in jar-File Exportieren Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
thE_29 JDeveloper erstellt ungutes WAR File IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
L Eclipse: import java.io.* anstatt import java.io.File, ... IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
G Eclipse - JAR FILE erzeugen! IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
M Netbeans Jar File builden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
F Eclipse: Jar-File durch Ant generieren? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 20
M 2 Programme mit einer Ant build-file starten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
T Probleme beim Erstellen einer Ant-File IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
K Eclipse: Erstelltes jar-File funktioniert nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
G JBuilder Jar File machen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
R Java-File in Standalone-Anwendung konvertieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
M NetBeans - "Empty Java File"-Template ersetzen/bea IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P jar File in Eclipse einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
O File(s)/Package(s) zu Archiv HINZUFÜGEN IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M JBuilder 9 Help File!? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse - Class File Editor -> Source not found IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
N NetBeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
M Netbeans nutzt veraltete Bibliotheken für JAX-WS IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
W Debugger - Netbeans vs. VSCode IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J Erstellen eines java Projekts mit Gradel in netbeans. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
R Ist netbeans noch eine gute Wahl? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
mihe7 NetBeans 17 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
MiMa Netbeans zu IntelliJ mit Maven konvertieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
I NetBeans 15 - Strg+Z (undo) und Strg+Y (redo) funzen nicht mehr nach Start der Java-Anwendung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
J Netbeans 14 friert unter Linus Mint 21 prötzlich ein IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
mihe7 NetBeans NetBeans 16 ist da IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
M Altes Java Projekt in Netbeans importieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
MiMa Methoden in Netbeans vergleichen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 23
M Linux Mint - Apache NetBeans 14 - Installationsanleitung deutsch IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Neumi5694 Netbeans Warnung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
T NetBeans NetBeans IDE 13 | Cannot find main class IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
J Seltsames Verhalten einer Klasse in netbeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
S License-Header in NetBeans 8.2 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G Netbeans 12.6 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
kodela NetBeans App lässt sich ausßerhalb von NetBeans nicht ausführen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
J Netbeans - WakaTime - Plugin sendet keine Daten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
J Netbeans - Werte von Variablen überwachen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
donnico2 Fehler beim Installieren von Apache Netbeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J netbeans - refactoring funktioniert nicht mehr IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
S Netbeans unterstützung für "Rule Switch" - Bug? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
O NetBeans Netbeans 12.0 - Hintergrundfarbe, auch im Navigator und Projekt umstellen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
J Kombinationsproblem: netbeans, gradle, mysql, json IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
O NetBeans Netbeans 8.2 mit JKD 15 ? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J Seltsames Verhalten von netbeans bezüglich fxml Dateien IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J netbeans 12 - wie -Xlint:deprecation aktivieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
J Netbeans 11.1 - Gradel aktualisieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
E Suche aktuelle Netbeans-Version für Win 10 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 30
B Netbeans: Java Script Libraries funktioniert nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
J NetBeans Projekt erstellen nicht möglich IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
G eigene Library In NetBeans 11.1 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J Bekomme keine lauffähige jar (netbeans/gradle) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
J Install JasperReports on netbeans/gradle Projekt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
W NetBeans Umzug von Netbeans 8.2 -> Netbeans 11.1: Plug-Ins IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
F Umstieg von Netbeans 8 mit JDK 8 auf Apache Netbeans 11 mit OpenJDK 12 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
MiMa JavaFX in Netbeans 11 installieren? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 32
G NetBeans Netbeans 8.2 hängt sich auf IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 15
W Netbeans and Git Projects IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
J NetBeans Dokumentation anderer Projekte IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
N Weder Eclipse noch Netbeans funktionieren auf Ubuntu 18.04 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
J NetBeans Download NetBeans und Java SDK IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
MiMa compile with -Xlint bei Netbeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
C Netbeans Meldung: Git Push Failed IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
TheJavaKid NetBeans JDBC Library mit Netbeans in Jarfile mit packen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 13
J Netbeans: Einsicht in den Programmlauf IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
J NetBeans Notizen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C maven startet jetty, netbeans "run" startet glassfish IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
L NetBeans NetBeans autofill einrichten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
pcfreak9000 Eclipse Netbeans generics IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
K Netbeans + Maven: default pom Inhalt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
B IDE Netbeans und Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
M Netbeans CSS code completion abgeschaltet IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
TomatenBrot447 Netbeans ziegt mir falsche Tasteneingabe an IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2

Ähnliche Java Themen

Neue Themen


Oben