RFR: 8078519 Can't run SA tools from a non-images build

Staffan Larsen staffan.larsen at oracle.com
Thu Apr 23 14:13:23 UTC 2015


Please see description of the problem in the bug report: https://bugs.openjdk.java.net/browse/JDK-8078519 <https://bugs.openjdk.java.net/browse/JDK-8078519>

The simple fix is included below.

Thanks,
/Staffan


diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
@@ -259,7 +259,12 @@
      saProps = new Properties();
      URL url = null;
      try {
-       url = VM.class.getClassLoader().getResource("sa.properties");
+       if (VM.class.getClassLoader() == null) {
+         url  = ClassLoader.getSystemResource("sa.properties");
+       }
+       else {
+         url = VM.class.getClassLoader().getResource("sa.properties");
+       }
        saProps.load(new BufferedInputStream(url.openStream()));
      } catch (Exception e) {
        System.err.println("Unable to load properties  " +
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20150423/ec9e5c77/attachment.html>


More information about the serviceability-dev mailing list