2014-07-08 70 views
1

在我工作的地方的服務器是一個JBoss實例,它具有以下命令行:未記錄的Java命令行選項?

/usr/java/jdk1.6.0_31/bin/java -Dcom.sun.management.jmxremote -Dprogram.name=run.sh -server -Xms464m -Xmx464m -XX:MaxPermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.net.inetaddr.ttl=0 -Dcom.sun.management.jmxremote -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=20071 -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/usr/java/jdk1.6.0_31/lib/tools.jar org.jboss.Main -P /opt/jboss/server/default/site-deploy/example.com/boot-1.properties -c default

我有幾個問題:

我明白-D選項集指定的屬性,例如-Dsun.rmi.dgc.server.gcInterval=3600000將財產sun.rmi.dgc.server.gcInterval設置爲值3600000。那麼-D沒有等號的選項怎麼樣,比如-Dcom.sun.management.jmxremotecom.sun.management.jmxremote的值是多少?

2.我找不到任何文件解釋-P-c選項的作用。 java -versionman java都沒有提及它們。我的猜測是,-P的意思是「從指定的文件加載屬性。」我不知道-c是做什麼的。

3.令牌org.jboss.Main似乎不是前面-classpath選項的一部分。它是Java告訴它調用的類的名稱,例如java Foo如何調用Foo的類?沒有值

+0

'-P'和'-c'貌似程序參數,而不是選擇。是的,'org.jboss.Main'似乎是主要方法的類。 –

+0

通常(對於'-D'問題)我會說看到文檔,但[文檔](http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html )似乎沒有說明'='的含義! –

回答

1
/usr/java/jdk1.6.0_31/bin/java -Dcom.sun.management.jmxremote -Dprogram.name=run.sh -server -Xms464m -Xmx464m -XX:MaxPermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.net.inetaddr.ttl=0 -Dcom.sun.management.jmxremote -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=20071 -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/usr/java/jdk1.6.0_31/lib/tools.jar org.jboss.Main -P /opt/jboss/server/default/site-deploy/example.com/boot-1.properties -c default 

系統屬性意味着系統屬性是,和值是空字符串""

那些是命令行參數JBoss的主要類

那個班級來自其中一個班級,打開run.jar並驗證

+0

因此'-c default'意味着參數'default'被傳遞給Main類? – dirtside

+1

yes有4個參數傳遞給Main類'[「-P」,「/opt/jboss/server/default/site-deploy/example.com/boot-1.properties」,「-c」,「default」 ]'這是數組表示 –

+1

@dirtside:* org.jboss.Main後面的所有內容都是傳遞給Main.main的參數。 –

0

下面的鏈接文件的所有選項到JBoss run.sh腳本:

Chapter 5. Starting and Stopping JBoss

usage: run.sh [options] 
    -h, --help     Show this help message 
    -V, --version    Show version information 
    --       Stop processing options 
    -D<name>[=<value>]   Set a system property 
    -d, --bootdir=<dir>   Set the boot patch directory; Must be absolute or url 
    -p, --patchdir=<dir>  Set the patch directory; Must be absolute or url 
    -n, --netboot=<url>   Boot from net with the given url as base 
    -c, --configuration=<name> Set the server configuration name 
    -B, --bootlib=<filename> Add an extra library to the front bootclasspath 
    -L, --library=<filename> Add an extra library to the loaders classpath 
    -C, --classpath=<url>  Add an extra url to the loaders classpath 
    -P, --properties=<url>  Load system properties from the given url 
    -b, --host=<host or ip>  Bind address for all JBoss services 
    -g, --partition=<name>  HA Partition name (default=DefaultDomain) 
    -u, --udp=<ip>    UDP multicast address 
    -l, --log=<log4j|jdk>  Specify the logger plugin type