Java programs have to be compiled before they can be run. If you’re using an IDE like Eclipse or Netbeans you might not need to do this. But if you’re having trouble compiling java from the command line, here’s how to fix it.
-Open Control Panel, then System
-"Advanced System Settings"
-"Environment variables"
-Add a new "System Variable"
-Name it (e.g. "0java"). The "Value" is to the installation location of the Java Development Kit
-Something like C:\Program Files\Java\jdk1.8.0_71
---That’s for Java 8, update 71 (for some reason Java likes to add a 1. before the actual version number. So Java 1.8 is really Java version 8 and 1.7 would be version 7)
-Now edit the "path" system variable.
-Click new, then type %VARIABLE_NAME%\bin
---My example would be %0java%\bin
-Close and reopen command prompt and now the javac command should work
TO COMPILE & RUN:
-Find your .java source file in command prompt
-type "javac" then the name of the file: "javac MyProgram.java"
-Then "java" then the class name with no extension: "java MyProgram"
More Details on Java_Home http://www.mkyong.com/java/how-to-set...
Running Java from command line http://introcs.cs.princeton.edu/java/...
Download jdk http://www.oracle.com/technetwork/jav...
На этой странице сайта вы можете посмотреть видео онлайн Java Set-up: Add Java to Path Environment Variable & Java Command Line длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь TanUv90 06 Февраль 2016, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 34,615 раз и оно понравилось 175 зрителям. Приятного просмотра!