Skip to content

Commit

Permalink
[openrndr-application] Fix restartJVM for JVM 18
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Sep 2, 2022
1 parent e0fe2b9 commit 29beddc
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -27,9 +27,10 @@ private fun restartJVM(): Boolean {
System.err.println("Warning: Running on macOS without -XstartOnFirstThread JVM argument. Restarting JVM with -XstartOnFirstThread.")

// restart jvm with -XstartOnFirstThread
val separator = System.getProperty("file.separator")
val classpath = System.getProperty("java.class.path")
val mainClass = System.getenv("JAVA_MAIN_CLASS_$pid")
val separator = System.getProperty("file.separator") ?: error("file.separator not set")
val classpath = System.getProperty("java.class.path") ?: error("java.class.path not set")

val mainClass = System.getenv("JAVA_MAIN_CLASS_$pid") ?: System.getProperty("sun.java.command") ?: error("JAVA_MAIN_CLASS_$pid and sun.java.command not set")
val jvmPath = System.getProperty("java.home") + separator + "bin" + separator + "java"

val inputArguments = ManagementFactory.getRuntimeMXBean().inputArguments
Expand Down

0 comments on commit 29beddc

Please sign in to comment.