0

I am running maven build -PautoInstallPackage on my AEM project and facing the following error.

Can't find tools.jar. Rerun delombok as: java -cp lombok.jar:/path/to/tools.jar lombok.launch.Main delombok /Users/ropatel/Documents/dev/local-project-folder/java /Users/ropatel/Documents/dev/local-project-folder/services/target/generated-sources/wsimport -d /Users/ropatel/Documents/dev/local-project-folder/services/target/src-delomboked

I have only made 2 changes since the last successful build. Removed some cache from my computer and updated to MacOs Big Sur. I have had security issues with mac OS update before but I made sure I provided java full disk access right now. Did anyone face this issue? I am running AEM 6.5 service pack 4 or 5. enter image description here

romie99
  • 305
  • 3
  • 4
  • 18
  • Did you update to Java 9 or later? The "tools.jar" file goes away in Java 9, so you will need to update other things (e.g. Lombok) that internally depend on "tools.jar". – Stephen C May 03 '21 at 02:07
  • @StephenC I am still using the JDK 1.8 – romie99 May 03 '21 at 02:56
  • Can >>you<< find the "tools.jar" file then? Maybe the problem is that you have set `JAVA_HOME` incorrectly. Clearly, this is a config problem of some kind ... so you should be trying to work out what has changed since ... when it was working. – Stephen C May 03 '21 at 03:00
  • I am unable to see the jdk folders in my Mac. Not sure why. Been trying to access it for a while. all the hidden files are made visible as well. – romie99 May 03 '21 at 03:29
  • 1) Use the `find` command to search for `tools.jar`. 2) If you are unable to see the JDK folders, perhaps you uninstalled the JDK? – Stephen C May 03 '21 at 03:33
  • I was able to find a workaround. Open Java control panel ,Got the path "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java". Also, The only thing I did was to update the OS. – romie99 May 03 '21 at 03:42
  • @StephenC I was able to find the tools.jar file in the libs folder. This is the path for the JDK : /Library/Java/JavaVirtualMachine – romie99 May 03 '21 at 03:48
  • So. Basically, you do have a JDK installation. But Maven is not finding it. Run `mvn -version` and check what Java home is printed out. See also https://stackoverflow.com/questions/15279586 – Stephen C May 03 '21 at 03:49
  • Maven home: /usr/local/Cellar/maven/3.6.0/libexec Java version: 1.8.0_291, vendor: Oracle Corporation, runtime: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac" – romie99 May 03 '21 at 03:55
  • So you need to set JAVA_HOME. See the link in my previous comment. – Stephen C May 03 '21 at 03:56
  • Set the Java home and did the build. Still the same error. MRK-C02VH4RGHTD6:~ ropatel$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home The issue is happening from the delombok plugin dependency in my Services folder. – romie99 May 03 '21 at 04:39
  • Maybe this will help? https://euedofia.medium.com/fix-default-java-version-on-maven-on-mac-os-x-156cf5930078. The problem is 1) I don't have a Mac and 2) there are many possible ways that Java on a Mac *could* be misconfigured so that Maven doesn't work properly. – Stephen C May 03 '21 at 04:48

1 Answers1

1

Be sure to use the proper JDK and set it as your JAVA_HOME, that message usually happens when Maven is using a JRE instead of the JDK.

ronnyfm
  • 1,973
  • 25
  • 31