昨晚使用eclipse的時候突然想到eclipse怎樣去區(qū)分使用jdk1.4還是jdk1.5,我使用jdk1.4在eclipse運行一個java程序這時的command是 C:\j2sdk1.4.2_05\bin\javaw.exe -Xbootclasspath:C:\j2sdk1.4.2_05\lib\tools.jar;C:\j2sdk1.4.2_05\jre\lib\rt.jar;C:\j2sdk1.4.2_05\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_05\jre\lib\jsse.jar;C:\j2sdk1.4.2_05\jre\lib\jce.jar;C:\j2sdk1.4.2_05\jre\lib\charsets.jar;C:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_05\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar -classpath E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\classes;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\jtds-1.0.3.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\poi-2.5.1-final-20040804.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\poi-contrib-2.5.1-final-20040804.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\poi-scratchpad-2.5.1-final-20040804.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\commons-logging-1.0.2.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\log4j-1.2.6.jar -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,suspend=y,address=localhost:1160 com.dengyin.data.transform.DoingTxt 紅色部分后面的那些包是在eclipse重設(shè)置好的.這是使用這些包作為啟動類.( set search path for bootstrap classes and resources )然而當我使用jdk1.5的時候的command是 C:\jdk1.5.0_03\bin\javaw.exe -classpath E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\classes;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\jtds-1.0.3.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\poi-2.5.1-final-20040804.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\poi-contrib-2.5.1-final-20040804.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\poi-scratchpad-2.5.1-final-20040804.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\commons-logging-1.0.2.jar;E:\Eclipse_WorkSpace\Eclipse_Work\DateTransform\lib\log4j-1.2.6.jar -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,suspend=y,address=localhost:1635 com.dengyin.data.transform.DoingTxt 我們看到這時并沒有-Xbootclasspath參數(shù),我們知道java程序中的所有依賴的類都會去classpath里面照.這時我想-Xbootclasspath做的工作應該時被javaw.exe做了,把那些系統(tǒng)必須的那些bootClass設(shè)置到了bootClasspath里面了.(以上想法時我個人的猜測,我上網(wǎng)找了但是沒有找到滿意的答案) 當你裝好了jdk1.5時,它會拷貝一份java.exe到windows(winNt)目錄下面,這樣你就可以不用設(shè)置JAVA_HOME然后把%JAVA_HOME%\bin放到系統(tǒng)的path目錄了, 而且這時java.exe會自己設(shè)置好bootClass,這樣你就不用在系統(tǒng)的環(huán)境變量里面設(shè)置ClassPath了. -Xbootclasspath:<directories and="" zip="" jar="" files="" separated="" by="" ;="">
set search path for bootstrap classes and resources -Xbootclasspath/a:<directories and="" zip="" jar="" files="" separated="" by="" ;=""> append to end of bootstrap class path -Xbootclasspath/p:<directories and="" zip="" jar="" files="" separated="" by="" ;=""> prepend in front of bootstrap class path 最后給出些%JAVA_HOME%\bin里面一些exe的用法.(網(wǎng)上找的) java.exe 用法:java [-options] class [args...] (to execute a class) 或 java -jar [-options] jarfile [args...] (to execute a jar file) where options include: -client to select the "client" VM -server to select the "server" VM -hotspot is a synonym for the "client" VM [deprecated] The default VM is client. -cp -classpath <directories and="" zip="" jar="" files="" separated="" by="" ;=""> set search path for application classes and resources -D<name>=<value> set a system property -verbose[:class|gc|jni] enable verbose output -version print product version and exit -showversion print product version and continue -? -help print this help message -X print help on non-standard options -ea[:<packagename>...|:<classname>] -enableassertions[:<packagename>...|:<classname>] enable assertions -da[:<packagename>...|:<classname>] -disableassertions[:<packagename>...|:<classname>] disable assertions -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions java -X -Xmixed mixed mode execution (default) -Xint interpreted mode execution only -Xbootclasspath:<directories and="" zip="" jar="" files="" separated="" by="" ;=""> set search path for bootstrap classes and resources -Xbootclasspath/a:<directories and="" zip="" jar="" files="" separated="" by="" ;=""> append to end of bootstrap class path -Xbootclasspath/p:<directories and="" zip="" jar="" files="" separated="" by="" ;=""> prepend in front of bootstrap class path -Xnoclassgc disable class garbage collection -Xincgc enable incremental garbage collection -Xloggc:<file> log GC status to a file with time stamps -Xbatch disable background compilation -Xms<size> set initialJava heap size -Xmx<size> set maximum Java heap size -Xss<size> set java thread stack size -Xprof output cpu profiling data -Xrunhprof[:help]|[: |
|