Skip to content

Commit 0ca3bbb

Browse files
committed
GH-331 - read main class from jar only for local application
1 parent 0ee55f3 commit 0ca3bbb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

visualvm/profiling/src/org/graalvm/visualvm/profiling/presets/ProfilerPresets.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ private static String getMainClass(Application application) {
260260
if (mainClass == null || mainClass.trim().isEmpty()) {
261261
mainClass = ""; // NOI18N
262262
} else if (mainClass.endsWith(JAR_SUFFIX)) {
263-
// application is launched with -jar and uses relative path, try to find jar
263+
// application is launched with -jar and uses relative path,
264+
// if we are on localhost try to read main class from jar file
264265
mainClass = ""; // NOI18N
265-
if (jvm.isGetSystemPropertiesSupported()) {
266+
if (application.isLocalApplication() && jvm.isGetSystemPropertiesSupported()) {
266267
Properties sysProp = jvm.getSystemProperties();
267268
if (sysProp != null) {
268269
String userdir = sysProp.getProperty("user.dir"); // NOI18N

0 commit comments

Comments
 (0)