BlogJava-学习,融通,构建自己的知识体系http://www.blogjava.net/gfh21cn/zh-cnMon, 12 May 2025 22:52:02 GMTMon, 12 May 2025 22:52:02 GMT60java.exe 的使用http://www.blogjava.net/gfh21cn/archive/2008/01/10/174215.htmlgfh21cngfh21cnThu, 10 Jan 2008 03:20:00 GMThttp://www.blogjava.net/gfh21cn/archive/2008/01/10/174215.htmlhttp://www.blogjava.net/gfh21cn/comments/174215.htmlhttp://www.blogjava.net/gfh21cn/archive/2008/01/10/174215.html#Feedback0http://www.blogjava.net/gfh21cn/comments/commentRss/174215.htmlhttp://www.blogjava.net/gfh21cn/services/trackbacks/174215.html  用JAVA很久,但一直没有了解JAVA.exe这个玩意儿
  今天偶然用了一下,一点小小心得
  1,参数传递
    java命令使用 -D参数名=参数值 来传递
     java -Dyourname="%JAVA_HOME%" yourclass
    java程序中使用获得
     System.getProperty("yourname");
    这个在很多应用中有体现
     
  2,设置初始堆栈
    java有个命令可以看如何设置
    java -X
    E:>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 initial Java heap size
    -Xmx<size>        set maximum Java heap size
    -Xss<size>        set java thread stack size
    -Xprof            output cpu profiling data
    -Xfuture          enable strictest checks, anticipating future default
    -Xrs              reduce use of OS signals by Java/VM (see documentation)
    -Xcheck:jni       perform additional checks for JNI functions
    -Xshare:off       do not attempt to use shared class data
    -Xshare:auto      use shared class data if possible (default)
    -Xshare:on        require using shared class data, otherwise fail.   
   
    一目了然,以前只是看别人在应用,但不知道出处,看来看书不仔细呀
 
  3,设置路径
     使用 -classpath 设置所需要的jar文件
     java -Dyourname="%JAVA_HOME%" -classpath ".;./yourjar.jar" yourclass
     开始忘记了那个.号,执行时老是报类找不到。
 
  4,使用bat
     这么多参数需要设置,每次都要打一大堆,使用批处理文件就方便多了
     将上面那么长的一段话写入批处理文件,直接执行批处理文件。
     


gfh21cn 2008-01-10 11:20 发表评论
]]>
学习,融通http://www.blogjava.net/gfh21cn/archive/2007/12/27/170795.htmlgfh21cngfh21cnThu, 27 Dec 2007 01:31:00 GMThttp://www.blogjava.net/gfh21cn/archive/2007/12/27/170795.htmlhttp://www.blogjava.net/gfh21cn/comments/170795.htmlhttp://www.blogjava.net/gfh21cn/archive/2007/12/27/170795.html#Feedback0http://www.blogjava.net/gfh21cn/comments/commentRss/170795.htmlhttp://www.blogjava.net/gfh21cn/services/trackbacks/170795.html

gfh21cn 2007-12-27 09:31 发表评论
]]>