Search code examples
javajavac

Java compile not working... installed JDK and it has worked before


OK... This is kind of odd. So, yesterday, on my new computer, I installed the latest JDK 8 for Windows 7. I input it to environmental variables, I did everything correctly, and I know it for sure because it worked yesterday. I compiled multiple .javas. But now today, I use the javac on any .java, and the CMD prompt just goes back to "C:\Users\Home Computer>" I've restarted, hours of research, but this problem seems new. Even uninstalled and reinstalled JDK. Any ideas? Thanks in advance.

Command Prompt Screenshot


Solution

  • Open CMD, type in "java -version", press Enter & show us what you got there. Does it look like:

    C:\Users\W>java -version

    java version "1.8.0_66"

    Java(TM) SE Runtime Environment (build 1.8.0_66-b17)

    Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

    C:\Users\W>

    You can debug it step by step following the official guide of Oracle or external document:

    https://docs.oracle.com/javase/tutorial/essential/environment/paths.html https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html