skip to Main Content

Since javax.* packages have been replaced with Jakarta.* packages in the latest release of spring 6 and hibernate I am facing a bit challenge to replace all import statements related to javax.* with Jakarta.* in all files(1000s of java files) at once. I am using the latest eclipse IDE and have ubuntu OS. Right now I am replacing it manually by opening one java file at a time. Is there a way to do this at once for all files?

2

Answers


  1. ctr+shift+o

    I think this will work.

    Login or Signup to reply.
  2. You could use the Eclipse Transformer tool available from the Apache TomEE project here:

    https://tomee.apache.org/latest/docs/jakartaee-9/eclipse-transformer.html

    "The Eclipse Transformer provides translation from javax to jakarta on various artifacts, including Java source source, compiled Java classes, along with jar, war and ear files."

    The README page contains instructions for building the transformer tool and documentation on how to use it.

    Another alternative would be use Eclipse’s search / replace across your entire codebase; see Replace String in all files in Eclipse. However that is potentially risky; e.g. because of the possibility of making mistakes in the patterns that you use.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search