This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Tomcat 9 with JDK 13

 
Ranch Hand
Posts: 84
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I currently have Tomcat 9 windows service running with jvm 9. Oracle operations, javax classes, etc. Should there be any issues with trying to move the JDK/JVM to 13? I' thinking of installing a separate Tomcat 9 service with JDK 13 rather than trying to change the JVM. I would on;y have access to the production server consoles through remote command line, not the Windows based Tomcatw file. Thank you.
 
Bartender
Posts: 21756
148
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a fundamental tenant that Java is backwards-compatible* So running Tomcat9 with any JDK that's at least the same version as what you've been running should work without any problems. You can, of course, have multiple JVMs installed and running at the same time on your machine, and all that you need to do to switch JVM versions is to point the Tomcat process' JAVA_HOME to the JDK you want to use and if it should fail, switch back.

I'm not sure where Tomcat gets the JAVA_HOME when you launch it as a Windows Service, but I'm sure it's in there somewhere.
 
Tommy Griffith
Ranch Hand
Posts: 84
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much. Yeah, when installing tomcat service, I was all command line...used setx to temporarily set JAVA_HOME, installed the service with service.bat, then removed the JAVA_HOME with "HKLM...etc.."

So the service just needs to know JAVA_HOME during installation.

So I was going to attempt the same with Tomcat 9 and JDK 13.

My concern is that Tomcat 10 is using that Jakarta EE stuff and it says you need to recode stuff, migrate, etc. However, I am confused as how that affects the JDK releases (as there are planned future JDK releases and JDK 8 is supported through 2030).

If I stick with Tomcat 9 and go to JDK 13, i shouldn't encounter this javax --> jakarta class stuff...praying? you think?

 
Tim Holloway
Bartender
Posts: 21756
148
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JEE is a completely different product than the JRE/JDK with little overlap. However, on the whole you can continue to run older JEE applications (such as webapps) without changes. Tomcat provides all of the JEE libraries, however, so changing JDK versions won't change what JEE versions it supports.
 
Saloon Keeper
Posts: 2514
118
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tommy Griffith wrote:...used setx to temporarily set JAVA_HOME, installed the service with service.bat, then removed the JAVA_HOME with "HKLM...etc.."...

Assuming HKLM stands for HKEY_LOCAL_MACHINE, I don't think you need to modify windows registry at all. Just using the SET JAVA_HOME="bar" command should be fine in your bat file as long as you use the same session.
 
Tommy Griffith
Ranch Hand
Posts: 84
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:JEE is a completely different product than the JRE/JDK with little overlap. However, on the whole you can continue to run older JEE applications (such as webapps) without changes. Tomcat provides all of the JEE libraries, however, so changing JDK versions won't change what JEE versions it supports.



Thanks, Tim. So it looks like...

Tomcat 9 and JDK 9 --> 13 shouldn't require changes.

Tomcat 10 and JDK 13...what about the "targeted at Jakarta EE 9" stuff with Tomcat 10? Would this require recode of webapps and/or migration (they have a migration tool in development)?

salvin francis wrote:

Tommy Griffith wrote:...used setx to temporarily set JAVA_HOME, installed the service with service.bat, then removed the JAVA_HOME with "HKLM...etc.."...

Assuming HKLM stands for HKEY_LOCAL_MACHINE, I don't think you need to modify windows registry at all. Just using the SET JAVA_HOME="bar" command should be fine in your bat file as long as you use the same session.



Hi, Salvin. Yeah, I was setting JAVA_HOME for the service install, but then used HKEY_LOCAL_MACHINE to get it out of there after install.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!