I have my Tomcat and Java installation in /opt but to be honest I don't really understand the Linux directories. I know I can technically get them to work almost anywhere. However, I would like to stick to convention. Where would these typically be installed? If it helps, only one user and root should be able to modify them. This server's only reason for existence is to run a Java application.
Depends how you are installing them, and who should be able to use those programs.
If you install them with rpm -Uvih or apt-get install or dnf install, they would be in /usr/bin but probably only as symbolic links.
Thank you for your reply. I should have mentioned how I'm installing them. I'm FTP-ing tar.gz files for each to the Linux environment, I'm not using the package manager. Should I still put them in /usr/bin? Thanks.
If you're running a personal test copy of Tomcat, you can simply plop it in your home directory. For system servers, I usually use /usr/local, although /opt is the place I'd probably put an app-specific or Spring Boot based Tomcat server.
Then there's /srv, but nobody really knows what to do with /srv.
For JREs and JDKs, Sun/Oracle has long had the standard that their Red Hat (RPM) release would install each JDK or JRE under /usr/java. I like that approach. Not least because I often make it a mountpoint so that it's relatively unaffected when I do major system upgrades. Basically, other than making an entry in the RPM software inventory database, the only thing different than unzipping an archive-form JDK/JRE under /usr/java is that the RPM kindly creates a /usr/java/latest alias to the latest JVM release installed.
Red Hat themselves also have an RPM install for Tomcat. I think it actually places Tomcat is /usr/local, but then creates softlinks so that TOMCAT_HOME (/usr/local/tomcat...)/config goes under /etc/tomcat/config, TOMCAT_HOME/logs links to /var/log/tomcat, /TOMCAT_HOME/webapps links to /var/lib/tomcat/webapps, and so forth. Essentially leaving CATALINA_BASE alone, but creating a softlink-based CATALINA_HOME.
Note that /usr/local is - according to the LSB - supposed to be read-only, which is one reason for all the aliasing. The other being that the alias locations are the standard location for generic Red Hat Linux application installed files.
When it comes to destroying a civilization, gas chambers cannot hold a candle to echo chambers.