首页 > 代码库 > 启动Eclipse、Tomcat时设置相关环境变量的批处理

启动Eclipse、Tomcat时设置相关环境变量的批处理

根据相应脚本建立以下cmd(bat也行)文件,并修改成你机器上的实际环境,相信会很方便你的操作,对于Java、Tomcat、Eclipse的初学者来说也可以了解大概需要设置哪些系统环境变量。

1、StartupJava.cmd设置Java环境变量的快捷方式

@Echo Off@Rem Set Java Environment Variable...@Rem Set Java Home...Set JAVA_HOME=C:\Java\jdk1.5.0_13@Rem Set Path...Set PATH=%JAVA_HOME%\bin@Rem Set ClassPath...Set CLASSPATH=.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;@Rem Set Directory...cd Start

2、StartupEclipse.cmd启动Eclipse的快捷方式

@Echo Off@Rem Startup Eclipse...@Rem Set Java Home...Set JAVA_HOME=C:\Java\jdk1.5.0_13@Rem Set Eclipse Home...Set Eclipse_Home=C:\eclipse@Rem Set Path...Set PATH=%JAVA_HOME%\bin@Rem Set ClassPath...Set CLASSPATH=.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;@Rem Run Eclipse...Start %Eclipse_Home%\eclipse.exe -Exit

3、StartupTomcat.cmd启动Tomcat的快捷方式 

@Echo Off@Rem Startup Tomcat...@Rem Set Java Home...Set JAVA_HOME=C:\Java\jdk1.5.0_13@Rem Set Java Path...Set PATH=%JAVA_HOME%\bin@Rem Set Java ClassPath...Set CLASSPATH=.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;@Rem Set Tomcat Home...Set CATALINA_HOME=C:\tomcatSet CATALINA_BASE=C:\tomcat@Rem Set Tomcat ClassPath...Set CLASSPATH=.;%CATALINA_HOME%\lib\jsp-api.jar;%CATALINA_HOME%\lib\servlet-api.jar;@Rem Run Tomcat...Call %CATALINA_HOME%\bin\startup.bat

4、ShutdownTomcat.cmd关闭Tomcat的快捷方式

@Echo Off@Rem Shutdown Tomcat...@Rem Set Java Home...Set JAVA_HOME=C:\Java\jdk1.5.0_13@Rem Set Path...Set PATH=%JAVA_HOME%\bin@Rem Set ClassPath...Set CLASSPATH=.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;@Rem Set Tomcat Home...Set CATALINA_HOME=C:\tomcatSet CATALINA_BASE=C:\tomcat@Rem Set Tomcat ClassPath...Set CLASSPATH=.;%CATALINA_HOME%\lib\jsp-api.jar;%CATALINA_HOME%\lib\servlet-api.jar;@Rem Run Tomcat...Call %CATALINA_HOME%\bin\shutdown.bat

 

  

启动Eclipse、Tomcat时设置相关环境变量的批处理