0

I'm a complete noob and have been trying to set my mac to learn Java. I have installed JDK 10.0.1 and eclipse oxygen. I also successfully edited the JAVA_HOME variable to point to my jdk location using this: Setting JAVA_HOME environment variable on MAC OSX 10.9

So far so good, I was able to run simple programs both on eclipse and on terminal ( was having trouble for a while because I couldn't run "HelloWorld" from terminal as it was under a separate package) after using the top answer from Running java in package from command line

However my friend later told me that if I wanted to run java programs from terminal, I'd need to edit PATH variable as it was where the os looks for executables. A lot of websites mentioned editing PATH as well. I ran echo $PATH and terminal outputted /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin.

So I'm really confused that if I haven't edit PATH, then why am i able to run commands like java or javac from terminal? The /usr/bin folder has java javac javadoc etc aliases inside it, could that be the reason?

0 Answers0