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启动时,可能会出现The JAVA_HOME environment variable is not defined correctly的错误信息。这是因为JAVA_HOME环境变量没有正确设置。需要检查JAVA_HOME环境变量是否正确设置。 2.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`...
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 ...
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_...
Environment.SetEnvironmentVariable("PATH", "C:\\Program Files\\Java\\jdk1.8.0_201\\bin", EnvironmentVariableTarget.Machine); 需要注意的是,如果不加第三个参数,则只会修改当前进程的环境变量。使用 ...
例如,通过“Add Action”->“Set system Environment Variable”添加环境变量,如`JAVA_HOME`和`TOMCAT_HOME`。`$USER_INSTALL_DIR$`是安装目录的变量,可以用来指向程序的实际位置。 5. **创建快捷方式**:通过...
1.12. Apache Tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...