This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have an applet packaged as a jar that depends on another.jar. Unfortunately another.jar depends on JNI calls to communicate with a .dll, and I need to place both of these jars (applet and another.jar) in the install location of the C++ application and the aforementioned .dll. This means that although I do my development work in Eclipse with the standard C:\workspace\myapp\src and C:\workspace\myapp\bin directories, I need to package up the class files from bin into a jar, then copy them to the install location mentioned earlier. Being a bit of a novice when it comes to using Eclipse beyond being simply a source editor, and even more of a novice with applets, i cannot for the life of me figure out how I would debug this applet now. Is there some option in eclipse where i can select the class files in eclipse, or a jar, and tell eclipse to run this FROM the directory where the application is? Furthermore, as the Applet depends on another.jar, how will Eclipse handle debugging once control passes from the Applet boundary to another.jar?
I suspect that this problem has not much to do with applets (which are deployed in a very different way than you describe here), but much more with how to debug using Eclipse; so I'll move it to the IDE forum where the Eclipse experts hang out.
Joined: Dec 19, 2008
Thanks for the response and for moving the post. I think the major problem I have is that there is a fairly complex technology stack (for me) at work here. I don't know what you mean when you say "applets are deployed in a very different way than you describe here" - am I doing something wrong?
To clarify: I have a basic html page which contains applet.jar, which uses API.jar, which contains JNI calls, which talks to a .dll, which finally communicates with a C++ application. To get this to work, i have to dump the html page, the applet.jar, the api.jar, and the .dll in the install location of the C++ app. I can then talk to the app fine via the applet, but i do have some bugs, which is why id like to be able to add breakpoints etc in the applet, and then step through the code across the applet to API.jar boundary. As I have to package my class files up into 2 jars, and then move them from the eclipse workspace dir to the C++ app install, eclipse has no idea of their location, so i cant debug.
Am I thinking about this the wrong way, or even going about it the wrong way altogether?
My brain's running slow this morning, so I'm not sure I got all that, but I can tell you this:
Eclipse is essentially using the AppletRunner to debug applets. You can define the debug profile by bringing up the Run/Debug dialog and creating a new applet debug definition. Like all Java debugging sessions, that definition has a classpath option where you can add additional runtime directories and JARs above and beyond those already defined in the project itself.
That's really all you should need for the Java code. If you intend to descend into the JNI code and debug the C code, you'll need to install the C-language Eclipse plugin, since the standard Java developer's version of Eclipse only understands Java.
An IDE is no substitute for an Intelligent Developer.