Skip to content

Commit 1b4a66a

Browse files
committed
GH-369 construction of jar url fixed
1 parent fdb34e5 commit 1b4a66a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

visualvm/sa/src/org/graalvm/visualvm/sa/SAWrapper.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -48,13 +48,14 @@ class SAWrapper {
4848
// We will set those here before attaching to SA agent.
4949
System.setProperty("sun.jvm.hotspot.debugger.useProcDebugger", "true"); // NOI18N
5050
System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true"); // NOI18N
51+
URL saLibUrl = saLibFile.toURI().toURL();
5152
URL[] saLibUrls;
5253
if (saLibFile.getName().endsWith(".jmod")) { // NOI18N
53-
URL jmodUrl = new URL("jar:file:///"+saLibFile.getAbsolutePath()+"!/classes/"); // NOI18N
54+
URL jmodUrl = new URL("jar", "", saLibUrl+"!/classes/"); // NOI18N
5455
saLibUrls = new URL[]{jmodUrl};
5556
libraryPath = new File(jdkHome, "lib/"); // NOI18N
5657
} else {
57-
saLibUrls = new URL[]{saLibFile.toURI().toURL()};
58+
saLibUrls = new URL[]{saLibUrl};
5859
String osArch = System.getProperty("os.arch"); // NOI18N
5960
if ("x86".equals(osArch)) {
6061
osArch = "i386";

0 commit comments

Comments
 (0)