File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Java Debugger API example - running problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Debugger API example - running problem" Watch "Java Debugger API example - running problem" New topic

Java Debugger API example - running problem

Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
I am trying to run program that comes as a sample as part of Java Debugger Interface. This program provides command line trace of any input java program to it. It expects the name of java program to be traced as parameter.
This is located in package "". The online location of is at :-

And I pass another class to be traced as argument to this program called as which is located at package "". Both and are part of same java project. Now when I try to run using argument "" I get below exception in my console:-

java.lang.NoClassDefFoundError: com/sun/tools/example/trace/Client
Caused by: java.lang.ClassNotFoundException:
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Program will exit.
Exception in thread "main" -- VM Started --
-- The application exited --

Any idea why I am getting this error though is present at correct path as provided in argument to

Many thanks in advance.


********Deserve Before You Desire********
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
How are you including the class in the classpath? In other words, what command are you running, and what is the layout of the involved files and directories?
Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
I am using eclipse IDE to tun this application:-

I am passing argument "" as "Program Arguments" in "Arguments" tab of "Run Configuration". Then with this Run Configuration I run "" as java program.

My java project structure in eclipse is:-

jdb --> Java project Name
--src --> Source Directory

And output directory for this project is:- jdb/bin

Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
Any idea about this? Anybody?

Max Keller

Joined: Feb 09, 2014
Posts: 1
It's quite late for an answer. But anyway, I think the required classpath is not passed thru your remote vm (the one which runs your program under trace). Or in other words you must provide the remote vm with the required classpath. This is not done in the example application. Have a look at this example at connectorLaunchArguments(...)
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46375
Welcome to the Ranch Max Keller.
I agree. Here's the link:
subject: Java Debugger API example - running problem
It's not a secret anymore!