diff options
author | Jiri Vanek <[email protected]> | 2013-04-12 13:31:49 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-04-12 13:31:49 +0200 |
commit | 2f1248e599ff30dc01d6d1d7361fc0f4331a1b68 (patch) | |
tree | 84e64629330eda098b217309ccc2af14b30a16db /netx/net/sourceforge/jnlp/config | |
parent | d72aa240b794c81d4ec9aea24158564e696173a9 (diff) |
Added dialogue to allow setting of custom JRE
Diffstat (limited to 'netx/net/sourceforge/jnlp/config')
-rw-r--r-- | netx/net/sourceforge/jnlp/config/Defaults.java | 6 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 29 |
2 files changed, 31 insertions, 4 deletions
diff --git a/netx/net/sourceforge/jnlp/config/Defaults.java b/netx/net/sourceforge/jnlp/config/Defaults.java index 9e51d78..1191e9e 100644 --- a/netx/net/sourceforge/jnlp/config/Defaults.java +++ b/netx/net/sourceforge/jnlp/config/Defaults.java @@ -391,6 +391,12 @@ public class Defaults { DeploymentConfiguration.KEY_SECURITY_LEVEL, new SecurityValueValidator(), null + }, + //JVM executable for itw + { + DeploymentConfiguration.KEY_JRE_DIR, + null, + null } }; diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java index 98dc88b..61061d2 100644 --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java @@ -166,6 +166,7 @@ public final class DeploymentConfiguration { * JVM arguments for plugin */ public static final String KEY_PLUGIN_JVM_ARGUMENTS= "deployment.plugin.jvm.arguments"; + public static final String KEY_JRE_DIR= "deployment.jre.dir"; public enum ConfigType { System, User @@ -178,6 +179,10 @@ public final class DeploymentConfiguration { private File systemPropertiesFile = null; /** The user's deployment.config file */ private File userPropertiesFile = null; + + /*default user file*/ + public static final File USER_DEPLOYMENT_PROPERTIES_FILE = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR + + File.separator + DEPLOYMENT_PROPERTIES); /** the current deployment properties */ private Map<String, Setting<String>> currentConfiguration; @@ -221,8 +226,7 @@ public final class DeploymentConfiguration { */ public void load(boolean fixIssues) throws ConfigurationException { // make sure no state leaks if security check fails later on - File userFile = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR - + File.separator + DEPLOYMENT_PROPERTIES); + File userFile = new File(USER_DEPLOYMENT_PROPERTIES_FILE.getAbsolutePath()); SecurityManager sm = System.getSecurityManager(); if (sm != null) { @@ -415,8 +419,25 @@ public final class DeploymentConfiguration { return etcFile; } - File jreFile = new File(System.getProperty("java.home") + File.separator + "lib" - + File.separator + DEPLOYMENT_CONFIG); + String jrePath = null; + try { + Map<String, Setting<String>> tmpProperties = parsePropertiesFile(USER_DEPLOYMENT_PROPERTIES_FILE); + Setting<String> jreSetting = tmpProperties.get(KEY_JRE_DIR); + if (jreSetting != null) { + jrePath = jreSetting.getValue(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + + File jreFile; + if (jrePath != null) { + jreFile = new File(jrePath + File.separator + "lib" + + File.separator + DEPLOYMENT_CONFIG); + } else { + jreFile = new File(System.getProperty("java.home") + File.separator + "lib" + + File.separator + DEPLOYMENT_CONFIG); + } if (jreFile.isFile()) { return jreFile; } |