Location of javaagent jar in bootclasspath规格严格

Location of javaagent jar in bootclasspath规格严格,第1张

String urlString = ClassLoader.getSystemClassLoader().getResource("com/my/package/MyClass.class").toString(); 
 
urlString = urlString.substring(urlString.indexOf("file:"), urlString.indexOf('!')); 
URL url = new URL(urlString); 
File file = new File(url.toURI()); 
System.out.println(file); 
System.out.println(file.exists()); 

final String   bootClassPath; 
final String[] entries; 
 
// different VM may use a different string here... 
bootClassPath = System.getProperty("sun.boot.class.path"); 
entries       = bootClassPath.split(File.pathSeparator); 
 
for(final String entry : entries) 

    System.out.println(entry); 

RuntimeMXBean.getBootClassPath

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/2091762.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-07-22
下一篇 2022-07-22

发表评论

登录后才能评论

评论列表(0条)

保存