2016-11-21 1 views
0

Ich habe eine einfache "HelloWorld" -Klasse in einem kleinen Projekt, das mit Gradle (Gradle-Init - Typ Java-Bibliothek) initiiert wurde. Die HelloWorld.java-Datei befindet sich in [Projekt] /src/main/java/HelloWorld.java. Das Projekt wird kompiliert, wenn ich "gradle build"/"gradle compileJava" usw. starte.Debuggen von Java mit JDB und Gradle

Ich versuche, es mit JDB zu debuggen. Ich habe versucht: % jdb -sourcepath src/main/java Helloworld % jdb Hello World läuft etc ..

Ich erhalte "Fehler: Kann keine Hauptklasse Programm finden oder laden"

Was ist Ich mache falsch?

Antwort

1

Stellen Sie sicher, dass auch Klassenpfad hinzugefügt wird.

-sourcepath provides jdb with location of *.java 
-classpath provides jdb with location of *.class 

Sie haben es so nennen:

jdb -sourcepath src/main/java -classpath _location_of_compiled_code_ HelloWorld 
Verwandte Themen