Remember, the OS alternative should still refer to the JDK. So, even if you are indeed using the JDK instead of the JRE, the $JAVA_HOME has to point to the JRE. Which is where the tools.jar really resides. i want to learn kotlin use intellij ide And this is my JAVAHOME version ide : 2020. Which now resolves to /usr/local/java/jre/./lib/tools.jarĪnd finally to /usr/local/java/lib/tools.jar 11 i want to run my code in intellij ide (community edition) and when i try to run it, i got this error Cannot determine path to 'tools.jar' library for 18 (C:/Program Files/jdk-18.0.1.1) This is the ScreenShot of the error help me pls. This new setup will cause maven to look at the JRE directory, that is part of the JDK: $JAVA_HOME\.\lib\tools To solve this, the $JAVA_HOME variable should instead point to this location /usr/local/java/jre (assuming the JDK path is /usr/local/java) - there is actually jre folder inside the JDK installation directory, that comes with each JDK. It actually searches for the lib folder outside the java directory, because: $JAVA_HOME\.\lib\tools.jar The $JAVA_HOME variable pointed directly to my jdk folder ( /usr/local/java which was also the correct $PATH entry and alternative sym link). While I was using the correct JDK, I paid attention to the path of the tools jar maven complained about - it was expecting it to be $JAVA_HOME\.\lib\tools.jar The problem was quite stupid to solve, yet counter-intuitive. I am using version 1.6, 1.7 and 1.8 simultaneously, and I have played a lot with the alternatives to have everything set properly. I was quite frustrated at first, because I have installed both the JDK and JRE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |