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

Publicado el: 06 febrero 2016
en el 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...


En esta página del sitio puede ver el video en línea Java Set-up: Add Java to Path Environment Variable & Java Command Line de Duración hora minuto segunda en buena calidad , que subió el usuario TanUv90 06 febrero 2016, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 34,615 veces y le gustó 175 a los espectadores. Disfruta viendo!