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

Pubblicato il: 06 febbraio 2016
sul canale di: 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...


In questa pagina del sito puoi guardare il video online Java Set-up: Add Java to Path Environment Variable & Java Command Line della durata di ore minuti seconda in buona qualità , che l'utente ha caricato TanUv90 06 febbraio 2016, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 34,615 volte e gli è piaciuto 175 spettatori. Buona visione!