[英]Where is main config file in the Oracle Java JVM?
Where is main config file in the Oracle Java JVM? Oracle Java JVM中的主配置文件在哪里?
I need to hardcode some config to the JVM, like config: 我需要将一些配置硬编码到JVM,例如config:
javax.xml.accessExternalSchema=all
http.proxyHos=proxy
http.proxyPort=8080
javax.net.ssl.trustStore=c:/qqq
I tried to write it to the management.properties, but it doesn't helped... 我试图将其写入management.properties,但并没有帮助...
The JAVA_TOOL_OPTIONS environment variable allows you to set options like system properties globally in your environment. JAVA_TOOL_OPTIONS环境变量允许您在环境中全局设置选项,例如系统属性。 This means they will be picked up by every java command invokation. 这意味着它们将在每次Java命令调用中被拾取。
Some examples: http://developer-should-know.tumblr.com/post/119751759112/javatooloptions-environment-variable 一些示例: http : //developer-should-know.tumblr.com/post/119751759112/javatooloptions-environment-variable
System.setProperties(properties object);
This will set the system properties. 这将设置系统属性。
If you want to set a specified property, then use 如果要设置指定的属性,请使用
System.setProperty(key, value);//Both key and value should be string.
NOTE: This will first check the permission and then set it. 注意:这将首先检查权限,然后进行设置。 If permission denied, then SecurityException may occur. 如果权限被拒绝,则可能会发生SecurityException 。
I am not sure you are looking for the same or not, but you can modify deployment.properties
which is under below location in Windows: 我不确定您是否要查找相同的内容,但是可以修改Windows中以下位置下的deployment.properties
:
C:\\Users\\user-name\\AppData\\LocalLow\\Sun\\Java\\Deployment C:\\ Users \\用户名\\ AppData \\ LocalLow \\ Sun \\ Java \\ Deployment
Note: Change the user-name with your userName. 注意:用用户名更改用户名。
Have a look on the below link: 看看下面的链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.