![]() ![]() This solved my missing tools.jar issue, hope it did the same for you. If you are using latest MAC you require full JDK and JRE will not work and. 3- Select 'Alternate JRE' and from the drop down select 'jdk1.7xxx' (or whatever jdk you want to use' you can also select the workspace default jre. if you want to do Java development you must install JDK else JRE is sufficient. What you need to do is to uncheck all things that you would not be using, and leave only one JDK from JAVA version you prefer. As you can see on the picture above, I unchecked the JRE and left only JDK. If the instructions above did not help you can do the following: 1- from the run menu choose 'Run configurations.' 2- Choose your maven run profile and then click on the 'JRE' tab. In the list you'll see JDKs and JREs installed on your system. You'll see many options there, but what we're interested in is submenu Java and it's item Installed JREs. So, how to fix missing tools.jar in STS? First, go to Window -> Preferences. Since this tools.jar library could not be found in JRE, what you need to do is make your STS/Eclipse use JDK since it contains tools.jar. If you're using newer Java versions, it could happen that during the start of STS/Eclipse you get error saying that tools.jar could not be found. Eclipse is configured to use JRE instead of JDK. This tutorial will show you how to fix eclipse missing tools.jar issue. To compile your code with a specific JDK version, different than the one used to launch Maven, refer to the Compile Using A Different JDK example.Fix missing tools.jar in STS/Eclipse by replacing JRE with JDK In the same way, setting the source option does not guarantee that your code actually compiles on a JDK with the specified version. To avoid this issue, you can either configure the compiler's boot classpath to match the target JRE, or use the Animal Sniffer Maven Plugin to verify your code doesn't use unintended APIs, or better yet use the release option supported since JDK 9. ![]() ![]() Now from the command line mvn install does work Thanks for that. The pitfall is unintended usage of APIs that only exist in later JREs which would make your code fail at runtime with a linkage error. My JAVAHOME was pointing to the the JRE folder so I changed it to the JDK. Note: Merely setting the target option does not guarantee that your code actually runs on a JRE with the specified version. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |