Search code examples
javatomcat

Can we use packages having javax name in tomcat 10?


Can we use packages having javax name in tomcat 10? Or do we need to use jakarta instead of javax. For example javax.servlet.http.HttpServletRequest can be used in Tomcat 10 or we need to have javax replaced by jakarta

I have an old app that has struts and struts latest version is still uses javax in its imports

I looked into various stackoverflow answers like Tomcat 10.x throws java.lang.NoClassDefFoundError on javax.servlet.*


Solution

  • Short answer, no.

    Apache has a tool, Apache Tomcat migration tool for Jakarta EE that can help migrate an old application… but I would be surprised if it could convert Struts.

    You probably need to stay on an older Tomcat or bite the bullet and migrate to a newer framework.

    See Tomcat versions. You need to stay on 9.x if you are not ready for the Jakarta APIs.