Java als Standalone application ausführen

MTG

Mitglied
Ich benutze NetBeans 7.4 deutsch. Ich habe mir eine Java Web Application Projekt erstellt. Ich habe mir im Source Folder ein Verzeichnis "myjava.prototype" erstellt mit dem ich innerhalb des Projekts ein paar Sachen ausprobieren möchte. Wie bekomme ich jetzt aber eine test datei z.B.

file.java
Java:
    package myjava.prototype;

    public class MyClass {
              public static main() {
                        System.out.println("Hallo");
              }
    }

ausgeführt?
 

Androbin

Bekanntes Mitglied
Soweit noch nicht geschehen ( NetBeans sollte das automatisch machen, siehe Ordner "bin" ),
kompiliere die .JAVA in eine .CLASS -Datei ( CMD > "javac <Ordnerpfad>\<Dateiname>.java" )
Als nächstes: CMD > "cd <Ordnerpfad>" und dann "java <Klassenname>"
PS. Wenn du später mit grafischen Benutzeroberflächen arbeitest "javaW <Klassenname>"
 
Zuletzt bearbeitet:

MTG

Mitglied
erstmal Danke aber ich möchte es innerhalb von Netbeans ausführen. Beim Ausführen wirds ja als Web-Applikation ausgeführt. Sprich das die Ausgabe im Consolen - Fenster angezeigt wird.
 
Zuletzt bearbeitet:

Androbin

Bekanntes Mitglied
@MTG:

Ach so, aber dann verstehe ich das Problem nicht :rtfm:
In NetBeans klickst du einfach auf den "Run"-Button ( der, der wie eine "Play"-Taste aussieht ) :idea::bloed::popcorn:
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
R Java-File in Standalone-Anwendung konvertieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
T Eclipse Java Projekt funktioniert in Eclipse, aber nach export kein Dateizugriff IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
C In Eclipse Einrückung im Java-Editor einstellen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J Erstellen eines java Projekts mit Gradel in netbeans. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
I Suche eine IDE in deutsch für Java und Android IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 20
Jose05 UML Diagramme aus Java Code erstellen oder andersherum IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
T Eclipse von Java 1.8 auf 17 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
B Probleme beim erstellen von Java Class IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
F Eclipse für Java 1.8 ARM einrichten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
M import org.bukkit.plugin.java.JavaPlugin; funktioniert nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
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
R Java auf Linux gibt mir ein Fehler in der Konsole, wie löse ich sowas? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
K Java Editor Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
M Altes Java Projekt in Netbeans importieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
O Escape-Sequenzen in Java \b wird in Konsole falsch dargestellt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
O Java Eclipse Umlaute werden nicht richtig dargestellt in Konsole IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
B .exe Datei für Eclipse Java Programm erstellen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
B Wie nicht-java Datei mit Eclipse benutzen (Excel Datei einlesen)? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 16
J Eclipse - kein Server verfügbar zum ausführen meines Java Projektes IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
T Java-Version für BlueJ-Mac-Version IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
O NetBeans Java Projekt OHNE Maven erstellen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
O NetBeans Java Projekt OHNE Maven IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Jose05 Wie kann man aus einem Java-Code native Apps erstellen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 16
J Java-File Import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
brypa Probleme mit Java N-IDE App IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
Zrebna Eclipse Für Nutzung von JPA zwingend 'IDE for Java EE Developers notwendig'? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
P Error occurred during initialization of boot layer java.lang.module.FindException: Error reading module: IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
Robertop Groß- und Kleinschreibung bei Java-Templates ändern IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
sham5 Eclipse-Remote-Debugging von Java mit mehreren Prozessen oder Ports oder Netzen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Z java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
M Eclipse - Fehlermeldung bei JavaFX-Projekt "java.lang.module.FindException: Module javafx.controls not found" IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 23
N Eclipse aus Java-Application JavaFX machenModule javafx.controls not found IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
G Java Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
M Einzelne Java-Dateien mit Eclipse compilieren - Wie geht das? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
Robertop Eclipse Eclipse Startprobleme "Java was started but returned exit code=1" IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
B standard-version für Java IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
B Netbeans: Java Script Libraries funktioniert nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
coolian warum bekomm ich immer wieder wenn ich irgendwas mach eine java.lang.nullpointer exception in eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
M NetBeans Buildprozess inkludiert nicht die Classpath-Pakete (Java Ant) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
Tommy135 Error not found java.dll IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
K Eclipse EE und Java FX Autocomplete Probleme IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
O Eclipse aufräumen Java Projekte sortieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
H Eclipse Konsole gibt falsches Java Projekt aus IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
D Java Konsole gibt seit neustem nichts mehr aus. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
J NetBeans Download NetBeans und Java SDK IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
N NetBeans Java Code too large, wie *.java splitten? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
T Suche einen guten Java-Obfuscator? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
K Eclipse für Java, Python und C/C++ IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
W Java Byte Code Engineering Library (BCEL) Installation IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
R Unterschied zwischen Eclipse JDT und Java JDK IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
WetWer Welcher Java Editor wird empfolen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
R Cygwin in der Java Entwicklung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P Java IDE auswählen / einrichten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
N Eclipse Probleme beim Einrichten von Java Card Umgebung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
R Suche Benchmark- /Stresstesttools zur performance Testung von Java Anwendungen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
M Eclipse Java-Formatter IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
L0MiN Java Editor Spinnt nur mein Java Editor? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
D Java-Anwendung blockiert IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
M Eclipse Java Eclipse Windowbuilder - interaktive Diaglog-GUI IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 15
D NetBeans Maven Projekt in Netbeans => WEKA wirft (java.lang.OutOfMemoryError: Java heap space) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
A IDEA IntelliJ IntelliJ Maven oder Webprojekt, kann keine normalen Java Klassen erstellen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
P Java ohne IDE IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 15
M Java installiert sich falsch. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
M NetBeans java DB - The signer certificate will expire within six months. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
W Eclipse nach Java Update 8 Ant Probleme IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
O Eclipse Pfad zur Java-Source ändert sich automatisch IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
A Eclipse Export/Auscheacken des Java-Projekts aus Eclipse für anderen Distributionen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
S Eclipse Java 3d in Eclipse einbetten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 11
M Java-Code in C++ übersetzen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
J Eclipse Automatischer Import (wie java.lang) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
T java 3D zum laufen bringen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
J Jemand ne Ahnung warum meine Java Fenster immer schwarz werden? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
T Eclipse Java-Klassen aus dem einen in ein anderes Projekt einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
J IDEA IntelliJ Java source code und Dokumentation IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
S Frage zu Java IDE Android IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
T Eclipse Java src einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
F Java Editor Label Farbe IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
U Quellcode zwischen Java- und Androidprojekt teilen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
D Java IDEdroid IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
P Netbeans: Java-Plattformen verwalten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
X JAVA Turtle IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
A .java kontroller IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
I Java-Editor geht nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
H Eclipse Klasse in mehr Java Projekten verwenden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
T Eclipse Probleme Eclipse + Java 7 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
S Eclipse Java + Shellscript mit Maven und Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 11
F Eclipse: java.lang.NullPointerException bei System.console().printf() IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
A UML-Tool mit Java Source Code-Generator gesucht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
firefexx Kleines Java Projekt - Versionsverwaltung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
L GiT und Java IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
A java.lang.UnsatisfiedLinkError IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C Java-Decompiler IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
H Java Dateien in einen runnable jar packen mit eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
M Eclipse (Java) Cannot connect to VM IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
R Eclipse Run Java Application und JMF IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
F Eclipse Eigene Java Bibliothek erstellen/einbinden (ECLIPSE) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
T Eclipse Jython-Lib in Java-Projekt einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P java keytool fehler (Linux) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
B Eclipse import java. dann kommt kein Fenster IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
I Java Quellcode synchronisieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2

Ähnliche Java Themen

Neue Themen


Oben