`

Tomcat Enviroment Variable Configuration

阅读更多
public  void TomcatShutdownEnvironment(String path) throws Exception{

    String TomcatAdds="path";
InputStreamReader isr = new InputStreamReader(new
FileInputStream(path+TomcatAdds+"\\bin\\shutdown.bat"));
BufferedReader br = new BufferedReader(new
InputStreamReader(new FileInputStream(path+TomcatAdds+"\\bin\\shutdown.bat"))); 

String data = null;
data = br.readLine();
br.close();
isr.close();
if(data.equals("@echo off")){
StringBuffer input=new StringBuffer();
input.append("set path="+path.substring(1)+TomcatAdds+"\\jdk\n");
input.append("set classpath="+path.substring(1)+TomcatAdds+"\\jdk\\bin\n");
input.append("set JAVA_HOME="+path.substring(1)+TomcatAdds+"\\jdk\n");
input.append("set CATALINA_HOME="+path.substring(1)+TomcatAdds+"\n");

File file=new File(path.substring(1)+TomcatAdds+"\\bin\\shutdown.bat");
System.out.println(path.substring(1)+TomcatAdds+"\\bin/shutdown.bat");

insertStringInFile(file,1,input.toString());
System.out.println("tomcat modify");

}else{
System.out.println("tomcat has been ready");
}



}
分享到:
评论

相关推荐

    Tomcat的配置及出现问题的解决方法

    在Tomcat启动时,可能会出现The JAVA_HOME environment variable is not defined correctly的错误信息。这是因为JAVA_HOME环境变量没有正确设置。需要检查JAVA_HOME环境变量是否正确设置。 2.Tomcat无法从“开始”...

    tomcat启动问题

    echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined echo At least one of these environment variables is needed to run this program goto exit ``` 这段代码检查了`JAVA_HOME`...

    tomcat-5.5.23

    Install the JRE according to the instructions included with the release. <br>(1.3) Set an environment variable named JAVA_HOME to the pathname of the directory into which you installed the ...

    tomcat-7_API_帮助文档

    GLIBC 2.2 / Linux 2.4 users should define an environment variable: export LD_ASSUME_KERNEL=2.2.5 Redhat Linux 9.0 users should use the following setting to avoid stability problems: export LD_ASSUME_...

    C#设置与获取环境变量的方法详解

    Environment.SetEnvironmentVariable("PATH", "C:\\Program Files\\Java\\jdk1.8.0_201\\bin", EnvironmentVariableTarget.Machine); 需要注意的是,如果不加第三个参数,则只会修改当前进程的环境变量。使用 ...

    installanywhere使用资料(web)[归纳].pdf

    例如,通过“Add Action”->“Set system Environment Variable”添加环境变量,如`JAVA_HOME`和`TOMCAT_HOME`。`$USER_INSTALL_DIR$`是安装目录的变量,可以用来指向程序的实际位置。 5. **创建快捷方式**:通过...

    MySQL 5.6 Reference Manual

    1.12. Apache Tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Global site tag (gtag.js) - Google Analytics