As you probably know, javax had to change it's name to jakarta due to a trademark issue. Right now my company has gives our customers two .jar files, one for those using Tomcat 9 or earlier (javax) and one for Tomcat 10 (jakarta).
Is it possible to create one jar file that can see which Tomcat is used and for every import choose either javax or jakarta? This project does not use Spring.
I already found how to tell which Tomcat version is used.
I see JAVA does not have preprocessor directives like C++. Is there something similar that will allow me to swap the imports?
I also see that I don't have to use imports and just call the class using the whole path. This seems like a lot of work, but a possible solution. I just want to know if there is a quicker easier solution.