• 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Changing Tomcat Service JDK

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. If you have a minute, this is my challenge. I need to move the JDK (Java 9) for my Tomcat 9 service back to Java 8 (due to long term support).

I've read the JDK could "easily" be redirected via tomcat9w.exe. However, I do not have direct or remote access to the server console (Windows).

When I previously performed a simultaneous Tomcat and JDK upgrade, I set JAVA_HOME (temporarily) via ps_tools (remote DOS access to server) and setx (setting, clearing JAVA_HOME).

However, I don't want to go through this reinstall Tomcat service, etc if I can help it. Is there a way to redirect the JDK for an existing Tomcat service sans the Windows program tomcat9w.exe?

EDIT: I just found out that I can remote in to the server. So is tomcat9w.exe, if I change the "Java Virtual Machine" in the wizard Java tab and Save, that should be all right and automatically redirect the service? I presume I stop the service while doing this and start again after? This is scary.

Thank you very much.

 
Saloon Keeper
Posts: 22658
153
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't run critical Internet services on Windows and have not for a very, very, very long time. Actually, I haven't run Windows on anything for a very long time.

But a quick check on the Tomcatw.exe documentation at tomcat.apache.org indicates that you can set an execution parameter for tomcayt9w to point its JAVA_HOME to any JDK installed on the machine's filesystem.

However, Tomcatw is apparently designed to be run as a Windows Service, so I'm thinking that you'll actually need to execute the Service Manager control panel snap-in to configure it and that would require that you either have sysadmin provileges or be empowered to direct someone who does.
 
Thomas Griffith
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm, I was able to install the service in DOS (service.bat) so maybe I have admin access? I guess I'm wondering if anybody has done the "easy" #3 in this link and it automatically redirects...

https://www.codejava.net/servers/tomcat/4-ways-to-change-jre-for-tomcat
 
Thomas Griffith
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I found something interesting in tomcat9w.exe GUI. The Java Virtual Machine field in the Java tab indicates

C:...\jdk1.8.0_131\bin\server\jvm.dll

however, the Manager App for the Tomcat service (via browser) indicates JVM version 9.0.1.11...

I changed the tomcat9w.exe to C:...jdk11...etc... but no effect. It's like the tomcat9w.exe settings are completely ignored.

??
 
Thomas Griffith
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok... I found that Tomcat9w.exe appears to be pointing to a previous service I had installed... with the default Tomcat9 service name.

Is it possible to redirect Tomcat9w.exe to my current service name, Tomcat99?

thank you very much.
 
Thomas Griffith
Ranch Hand
Posts: 30
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...for future reference, I copied Tomcat9w.exe and renamed the copy Tomcat99w.exe, to match the service name, and I was able to change the JVM. The service exe file name has to match the Windows service name. Thank you.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic