Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Tomcat 9 with JDK 13

 
Ranch Hand
Posts: 87
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 23255
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 87
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Saloon Keeper
Posts: 23255
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2826
149
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 87
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Whatever you say buddy! And I believe this tiny ad too:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic