原因是后来较新版本的JDK(例如我使用的JDK1.6)安装完不会自动登记环境变量JAVA_HOME,JRE_HOME。像我在单位的环境,我的用户是受限制的(PowerUser),不方便设环境变量,于是我就找到了另外一个方法。
先看Tomcat的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在setclasspath.bat的开头声明环境变量,如我的就是:
rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 505241 2007-02-09 10:22:58Z jfclere $
rem ---------------------------------------------------------------------------
set JAVA_HOME=D:\Java\jdk1.6.0_11
set JRE_HOME=D:\Java\jre6
rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit
......
这样在每次运行startup.bat时就注册了JAVA_HOME,JRE_HOME。控制台窗口关闭后,这两个变量也将消失,不会再占用内存。运行一下,最终提示“信息:Server startup in xxxxx ms”就大功告成了。
分享到:
相关推荐
错误1:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program 错误2: Neither the JAVA_HOME nor the JRE_HOME ...
Neither_Snow_Nor_Rain_Nor_MITM_ 红蓝对抗 安全对抗 业务安全 安全威胁 金融安全
addition, you will need a development environment such as the JDK 1.1.6+ or the Java 2 Platform, Standard Edition (J2SE) 1.2.x or 1.3.x. A general familiarity with object-oriented programming ...
集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...
notEmpty Evaluate the nested body content of this tag if the requested variable is neither null nor an empty string. notEqual Evaluate the nested body content of this tag if the requested variable is ...
That said, this book is neither a comparative analysis nor a "bridge" tutorialno knowledge of C or C++ is assumed. C++ programmers, especially, may be as hindered by what they must unlearn as they ...
(b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...
The ancient Greeks discovered them, but it wasn't until the nineteenth century that irrational numbers were properly understood and rigorously defined, and even today not all their mysteries have been...
so nor neither的用法总结PPT学习教案.pptx
Neither the names of Licensor, nor the names ofany contributors to the Original Work, nor any of their trademarks or servicemarks, may be used to endorse or promote products derived from this ...
Notice that the multiplication operation defined by the table is neither associative nor commutative. a b c a b b a b c b a c a c c Find an efficient algorithm that examines a string of these ...
Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this course. Packt Publishing ...
It is well defined what issues the hat should be contacted about by the project members and people outside the project. 2.4. Outcome An “outcome” is the final output of the process. This is ...
the two propositions, and neither p nor q contains any constants except logical constants. And logical constants are all notions definable in terms of the following: Implication, the relation of a ...
the author(s) nor anybody connected to this software in any way can assume any responsibility. * All rights held by the author(s) or owner(s) of units or documents. _______________________________...
Neither...nor的用法小结.doc
Neither the data-driven nor the risk register approaches are able to model dependencies between different risk factors. Causal probabilistic models (called Bayesian networks) that are based on ...
the author(s) nor anybody connected to this software in any way can assume any responsibility. * All rights held by the author(s) or owner(s) of units or documents. _______________________________...
the author(s) nor anybody connected to this software in any way can assume any responsibility. * All rights held by the author(s) or owner(s) of units or documents. _______________________________...
This is because static data members are defined outside the class definition. On the other hand, you must include the header file for Foo if your class subclasses Foo or has a data member of type ...