Java Set-up: Add Java to Path Environment Variable & Java Command Line

Publicado em: 06 Fevereiro 2016
no canal de: TanUv90
34,615
175

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...


Nesta página do site você pode assistir ao vídeo on-line Java Set-up: Add Java to Path Environment Variable & Java Command Line duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário TanUv90 06 Fevereiro 2016, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 34,615 vezes e gostou 175 espectadores. Boa visualização!