昨晚使用eclipse的时候突然想到eclipse怎样去区分使用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重设置好的.这是使用这些包作为启动类.( 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参数,我们知道java程序中的所有依赖的类都会去classpath里面照.这时我想-Xbootclasspath做的工作应该时被javaw.exe做了,把那些系统必须的那些bootClass设置到了bootClasspath里面了.(以上想法时我个人的猜测,我上网找了但是没有找到满意的答案) 当你装好了jdk1.5时,它会拷贝一份java.exe到windows(winNt)目录下面,这样你就可以不用设置JAVA_HOME然后把%JAVA_HOME%\bin放到系统的path目录了, 而且这时java.exe会自己设置好bootClass,这样你就不用在系统的环境变量里面设置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的用法.(网上找的) 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]|[: |
|