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

preview_player
Показать описание
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
-Then "java" then the class name with no extension: "java MyProgram"

Рекомендации по теме
Комментарии
Автор

I don't think you have enough programs pinned to your taskbar lol

PenguinApple
Автор

This video is short, summarized and very easy to understand. Keep up the good work brother

armanpapa
Автор

I followed these instructions and nothing changed..

ayooitsya
Автор

Thank you so much for this video! Explained a thousand times better than my CS professor guiding us to set this up in class.

ChadMorningWood
Автор

Bruh you need to relax the compression on your voice

tommilne
Автор

what kind of command is javac-introcs

yt-
Автор

Wow, been struggling with this for over an hour following another tutorial. Yours took 3 minutes, Thank You:)

kimcrawford
Автор

sir what it mean's i am a
javac: file not found: First.java
Usage: javac <options> <source files>
use -help for a list of possible options

muhammadzubair
Автор

boi You're godsend for my problem. Everytime eclipse updates it erases itself from the path since it uninstalls past versions of itself. Thanks.

catedoge
Автор

Didn't know Badger from Breaking Bad knows his java

erikjongbloed
Автор

@TanUv90 you might get a small boost in viewers haha i like the short summary of it but the cutting in audio is kinda wierd

nnewram
Автор

amazing you solved it in a jiffy....i was wandering about it about 2 you very much

viveksaini