title: Overriding single classes from rt.jar
body: <p>I'm looking for a neat way to override a class from the bootstrap class path, <code>rt.jar</code>.
  The reason is OpenJDK7 bug <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7104625" rel="nofollow">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7104625</a></p>
  
  <p>The fix for this bug is a trivial (see linked mailing list post) change to <code>sun.awt.X11.XComponentPeer</code>. So I was wondering if there is an easy way to override just this one affected class on my classpath, without having to repack/rebuild rt.jar (so the fix isn't lost on the next automatic update of OpenJDK).</p>
  
  <p>Ideally, it would also affect Eclipse...</p>
  
  <p>I assume that <code>java -Djava.system.class.loader=myClassLoader</code> would work? Is there any other way to override a single class with such a "hotfix"? (Note: not used in my own code, but deep in Java AWT code)</p>