Solved

Modify JDK source during eclipse debug

Posted on 2010-11-30
4
549 Views
Last Modified: 2012-05-10
I want to debug the java source code in eclipse.
I am able to attach and see the JDK class files (as specified,e.g. here:
http://www.avajava.com/tutorials/lessons/how-do-i-view-and-debug-jdk-source-code-in-eclipse.html?page=3)
but I want to be able to stick a statement into the JDK source code.
e.g. in Container.addImpl():
System.out.println ("Container.addImpl(): " + component + "\tindex: " + index);
How do I do this?

0
Comment
Question by:allelopath
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
Valeri earned 200 total points
ID: 34239821
If you need this, it means that there is something wrong...?!
Anyway, one possible solution is to copy the source of the original java class and to add it to your package. In this way you will use the "local" copy of this class and you will be able to change anything in this class, according to what you need...
0
 
LVL 1

Author Comment

by:allelopath
ID: 34239983
I've now foudn the rt.jar in the package explorer.
I right-click to get Properties, then select Java Source Attachement and then specify a path:
C:/Program Files/Java/jdk1.6.0_18/src.zip
but still I get Container.class not Container.java
0
 
LVL 1

Author Comment

by:allelopath
ID: 34240640
I've also tried unzipped the src.zip and using that as the source attachment.
I can edit Container.java now, but when it runs it still uses the class file.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 300 total points
ID: 34243198
you'll need to add the source to a source folder and make the required changes
then in your eclipse run configuration change the classpath to either remove the jre library or move it after your user code
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
javap bin 2 41
type mismatch (Object[] to double[] 4 33
Eclipse Java import and method not resolved 4 49
Java class and jar 3 25
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question