如何更改docker上tomcat的jdk版本
我想在docker上的tomcat容器中使用jdk-17 因为tomcat上现在的openjdk-11.0.14.1+1不支持我的代码 (错误:无法解析类型 javax.servlet.http.HttpServletRequest。) 这让我很难过
代码正在使用tomcat 10和jdk17.0.2的eclipse上运行
,所以我尝试在tomcat上下载jdk17 并更改 /usr/local/tomcat/bin/catalina.sh 上的路径
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/jdk-17
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
,但 java --version
openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1deb11u1, mixed mode, sharing)
仍然相同
,您可以帮助我让我知道如何修复它吗?
I want to use jdk-17 in tomcat container on docker
cuz openjdk-11.0.14.1+1 which is now on the tomcat doesn't support my code
(Error : The type javax.servlet.http.HttpServletRequest cannot be resolved.)
which make me sad
The code is working on eclipse with tomcat 10 and jdk17.0.2
so I tried to download jdk17 on tomcat
and change the path on /usr/local/tomcat/bin/catalina.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/jdk-17
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
but the java --version
openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1deb11u1, mixed mode, sharing)
is still same
could you help me to let me know how to fix it..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论