Click here to Skip to main content
12,956,606 members (76,121 online)
Click here to Skip to main content
Add your own
alternative version


1 bookmarked
Posted 18 Oct 2013

Debug Java Code in Java COM Windows Application (Remote Java Debugging)

, 18 Oct 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Debugging Java JNI and C++ code in COM based application


I recently got the chance to setup Java debug environment for Java-COM based Windows application. Here the VB6 code is used for showing the User interface of application while Java and C++ code includes business logic of the application. To fix some bugs in the application, a debug environment was required which allows users to debug Java and C++ JNI code.

Using the Code

To debug C++, I used Visual Studio attach to process method and for Java code remote Java debugging of Eclipse was used.

Here are the details of the process that I used to debug Java.

We need to implement the following two steps:

  1. Launch the application and tell the JVM that it will be debugged remotely
  2. Create debug configuration in Eclipse IDE to debug application remotely. (in our case, it is localhost)

Pass the following argument to JVM:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8998

The above code should be placed at the location where JVM is loaded in the code.
Here 8998 denotes the port and suspend=n will make sure that the debugging is suspended till the Java code hits in the application.

In the Eclipse IDE, we need to create a new debug configuration and enter the following details in Connection Properties:

  • Host - localhost
  • Port - 8998

Now, click on apply, then launch the application. Now click on Debug in Debug configuration after setting debug points in the Java code.

Points of Interest

Using the above steps, we can debug the C++ and Java code simultaneously. This helped to understand proper functions flow in application.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Vivek Goyal
Software Developer (Senior)
India India
Software Engineer having hands-on experience with C, C++, C#, .NET, ASP.NET, SQL, Website designing technologies, Joomla CMS, Application development, COM, MFC, Installshield, Installscript project, Basic MSI

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 18 Oct 2013
Article Copyright 2013 by Vivek Goyal
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid