Package net.adoptopenjdk.icedteaweb.jvm
Class JvmUtils
java.lang.Object
net.adoptopenjdk.icedteaweb.jvm.JvmUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckVMArgs(String vmArgs) Check that the VM args are valid and safe.dropMissingModules(List<String> vmArgs) Removes modules this JVM lacks from --add-modules: a missing one aborts JVM startup, while --add-exports/--add-opens to a missing module only warn.static StringfindOnPath(String[] bins) Find a binary of the given binaries on PATH.static Stringstatic String[]https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624 Java Module VM arguments specified by app developer in jnlp file.static booleanisValidSecureProperty(String argument) A secure property is valid if it is in the whitelist or it begins with "jnlp." or "javaws."static booleanisValidStartingJavaModulesArgument(String argument) mergeJavaModulesVMArgs(List<String> vmArgs) Combines PREDEFINED_JAVA_MODULES_VM_ARGUMENTS with the Java Module VM Args in the input vmargs.parseArguments(String args)
-
Constructor Details
-
JvmUtils
public JvmUtils()
-
-
Method Details
-
checkVMArgs
Check that the VM args are valid and safe.Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
- Parameters:
vmArgs- a string containing the args- Throws:
IllegalArgumentException- if the VM arguments are invalid or dangerous
-
isValidStartingJavaModulesArgument
-
isValidSecureProperty
A secure property is valid if it is in the whitelist or it begins with "jnlp." or "javaws."- See Also:
-
getJavaWsBin
- Returns:
- the javaws binary.
-
findOnPath
Find a binary of the given binaries on PATH.- Parameters:
bins- list of binaries to look for- Returns:
- the absolute path to the first binary found
-
getValidStartingJavaModuleVMArguments
https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624 Java Module VM arguments specified by app developer in jnlp file. ITW adds its own set of jvm args either throughgetPredefinedJavaModulesVMArgumentsMap()or the itw-modularjdk.args file. These are required for the execution of ITW.Note: --module-path is not accepted by ITW as it would circumvent the classloader and security.
-
dropMissingModules
Removes modules this JVM lacks from --add-modules: a missing one aborts JVM startup, while --add-exports/--add-opens to a missing module only warn. E.g. JOSM's JNLP asks for javafx.* which plain OpenJDK does not have. -
mergeJavaModulesVMArgs
Combines PREDEFINED_JAVA_MODULES_VM_ARGUMENTS with the Java Module VM Args in the input vmargs. Does not check legality of args, this is done bycheckVMArgs(String)check -
parseArguments
- Throws:
ParseException
-