Avatar ·

Where is installed Java located on macOS? Path to JDK and JRE

Hi everyone! I'm a beginner Java developer, recently switched to Mac and can't figure out the location of Java. On Windows everything was simple — usually in `C:\\Program Files\\Java`. But on macOS I'm confused. I installed JDK 17 via the official installer from the Oracle website. After installation, I checked the version in the terminal: ```java java -version // output: java version "17.0.1" 2021-10-19 LTS ``` Everything works, but I can't find the installation folder. I tried looking in `/Library/Java/`, there's some folder `JavaVirtualMachines`, but inside it there's only `jdk-17.0.1.jdk` — it's some kind of package, not a folder. When I try to open it via Finder, it opens as a regular file. I need to know the exact path because I want to: 1. View the source code of standard classes (for example,