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

Veröffentlicht am: 06 Februar 2016
auf dem Kanal: 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...


Auf dieser Seite können Sie das Online-Video Java Set-up: Add Java to Path Environment Variable & Java Command Line mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer TanUv90 06 Februar 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 34,615 Mal angesehen und es wurde von 175 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!