• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up PATH before using Java the first time  RSS feed

 
Matthew John
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
My name is Matt and I am new to Java and Programming in general. I am trying to learn things on my own and let me tell you, it is extremely frustrating. I happened to stumble upon this thread while reading the FAQ's and I am a bit confused. I am reading that we are NOT supposed to set up a line in both User & System in Environment Variables? Is that correct? I could not get the correct output at the command line after typing 'java -version' and 'javac -version' until I set up a line in both User and System in Environment Variables. I am running Windows 10. Maybe this will help anyone reading this. This is how things are set up on my system:

1) Environment Variables > User variables for Matt > Path > C:\Program Files\Java\jdk1.8.0_74\bin // I added this line to User variables

2) Environment Variables > System variables > JAVA_HOME >C:\Program Files\Java\jdk1.8.0_74 // I also added this line to System variables
3) Environment Variables > System variables > Path > C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Wi... // This line was already here when I got here

Note: I added the 1), 2), and 3) just for reference for this thread.

Can anyone confirm whether this is correct or not?
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Your post appears to have been missed because you added it to an old thread; I shall split it into its own discussion.
As you will see in the Java™ Tutorials and our FAQ, it is usual for that sort of error to occur before you set up the PATH. You may find there is no need for the Java home variable if you are not using NetBeans.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!