Reputation: 664
I have a simple 'HelloWorld' class within a small project that was initiated with Gradle (gradle init --type java-library). The HelloWorld.java file is located in [project]/src/main/java/HelloWorld.java. The project gets compiled when I run "gradle build" / "gradle compileJava", etc.
I am trying to debug it using JDB. I've tried: %jdb -sourcepath src/main/java HelloWorld %jdb run HelloWorld etc..
I am getting "Error: Could not find or load main class Program"
What am I doing wrong?
Upvotes: 1
Views: 1380
Reputation: 13375
Make sure to add class path as well.
-sourcepath provides jdb with location of *.java
-classpath provides jdb with location of *.class
You have to call it like this:
jdb -sourcepath src/main/java -classpath _location_of_compiled_code_ HelloWorld
Upvotes: 1