I have a requirement/situation where i need to deploy an application which runs in jre8 and tomcat8 in a server which already has jre6 and tomcat 6.
I don't want to make changes to the existing configuration(jre6 and tomcat 6)
Can i use server jre and configure it? Could you please detail it out? Please assist me on this. Thanks a lot in advance.
您可以尝试为Java 6 / Tomcat 6重新编译项目,但这只有在到目前为止没有使用Java 7/8和Tomcat 7/8功能的情况下才能成功。
You can have multiple JDK
and JRE
on same machine. But, in your environment variable at a time, you will have one Java
version to use (by default).
You need to change the configuration file of specific server/application to use specific Java
version.
I had a situation to configure an application that would run in Tomcat 8 and jre 9 in a windows server which already had a Tomcat 6 instance running with jre 6. I came across 2 possibilities and brought up both the applications.
If you would like to install the tomcat as windows service it makes it much simpler.
1. To install tomcat as windows service
It is a better choice as it is not required to modify anything for the existing configuration and will not change default jre.
2. Copy another instance and configure
Copy tomcat 6 and tomcat 8 in a folder
If JAVA_HOME and JRE_HOME were set, remove them.
Set path for jdk/jre in catalina.bat or add a file setenv.bat in the same location, something like,
set JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_131 and in another instance tomcat 6
set JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_45
Make sure both instances have different port configurations in server.xml
Different JREs and different Tomcat installations put aside. If you have only one tomcat, you can run multiple instances by having separate CATALINA_BASE directories. (like so: tomcat - CATALINA_BASE and CATALINA_HOME variables )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.