Java Tutorial : Install java development kit on your computer, then you can write java programs on notepad and compile and run them using cmd.You have to set the path of compiler by going to environment variables in computer properties.
Java Development Kit download link: www.oracle.com/technetwork/java/javase/downloads/index.html
Steps for Setting up java compiler
(1) Install Jdk
(2) Go to the installed java folder. Then go to "bin" folder inside.
(3) Right click on any of the files and go to properties. Copy the Location.
(4) Go to my computer.Right click on it and go to properties.
(5) Click on environment variables(it may be inside Advanced System Settings).
(6) Create a new environment variable having name "Path" and value as whatever location You copied.
(7) Now Your compiler is ready.