First of all, set environment variables.
This can be found (i'm using win 8) by
1. Click Start
2. Search 'This PC'
3. Right click and choose properties.
4. On the left side menu, choose 'Advanced System Settings', and screen will show this popup 'System Properties'.
5. Click Environment Variables, find 'Path' on 'System Variables' and click edit
6. Add 'javac.exe' file folder location to 'Variable value'.
7. Click ok.
8. Open your cmd and write : "javac". It is succeeded when display like this.