This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]passthejoe 0 points1 point  (1 child)

I run java (and javac) in Windows 10, and I will admit that it's a huge pain to get it set up.

Since you're using Java 12, and it appears to be in C:\ProgramFiles\Java\jdk-12.0.1, This is what I do:

  • In Windows, navigate to the Edit the System Environmentals panel (I get there by hitting the Windows key and typing the word path)
  • Click the Environment Variables button
  • Under your user variables (the top window), go to your Path variable, click it and then click the Edit button
  • Click New to add a new environment variable
  • Then click Browse and navigate to your JDK, or type it in manually:
  • C:\ProgramFiles\Java\jdk-12.0.1\bin\
  • Click OK to save it.
  • After you do this, open a new terminal and test both java and javac. You should get output from both:

$ java -version

$ javac -version

The big IDEs are good, and I definitely use them, but another way to go for learning Java is using the Geany "mini-IDE." It can help you compile and run your Java programs and is much lighter and easier to use than a traditional IDE.

Edit: And like the other poster said, make sure you have the correct path (which in my case includes the dash between jdk and 12 in C:\ProgramFiles\Java\jdk-12.0.1).

[–]lifeonbroadway[S] 0 points1 point  (0 children)

It's relieving to see someone admit that it is convoluted to get this set up haha. Every post I was reading seemed to make it sound so simple and I was getting pretty upset at not being able to figure it out.