0

I have a code which is running inside Oracle JVM. Is there any way to debug the java code which is running inside the oracle jvm??

Thanks in advance..

anibjoshi
  • 35
  • 1
  • 5
  • 1
    Oracle 11G is a database. Are you using an IDE? Do you want to connect to an external JVM? Yes, it is possible to debug Java code. Need more information to tell you how. – Elliott Frisch Jul 15 '14 at 12:56
  • I am running JAVA code inside the Oracle JVM and i want to debug that. I do not need to connect to any external JVM. – anibjoshi Jul 15 '14 at 12:59
  • I think what you are talking about is remote debugging. http://stackoverflow.com/questions/975271/remote-debugging-a-java-application – selalerer Jul 15 '14 at 13:00
  • @anibjoshi The Java code running in the Oracle JVM? Yeah, there is your external JVM. Next you need a debugger. Generally those are part of an IDE. – Elliott Frisch Jul 15 '14 at 13:01

1 Answers1

2

Debugging method would be different depending on how you are running the program.

1.If you are running the code from a Java IDE (e.g. Eclipse), you can add Oracle JVM as Runtime (Preferences > Java > Installed JRE) and then launch the Java program from the IDE in debug mode (Debug As > Java Application). This will allow the execution to be suspended at the marked breakpoints and you can browse the code in IDE in suspended mode.

2.If you are running the code in a container or in a standalone JVM (class with main() method), then you may have to enable remote debuging while launching the program. For enabling remote debugging in a container, refer to your container docs. If you are running a standalone program, then use below command for launching the program:

java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n NameOfYourMainClass

Once your application is launched with remote debugging enabled, you can use an IDE (e.g. Eclipse) to debug. Refer to this article for detailed steps: http://java.dzone.com/articles/how-debug-remote-java-applicat

I hope, it helps!

Pat
  • 2,026
  • 4
  • 17
  • 21