To compile and run java file from command prompt we need to set path of java bin folder. Please follow below steps:
- Click Window — Run –Type cmd in the box –> Click OK
- It will open command prompt
- Type command cd\ to go to c folder
- To set path find your java installation folder then search bin folder. Copy your java bin folder URL path and paste to command prompt shown in example below: (set path=C:\Oracle\Middleware\jdk160_29\bin;)
- To test if class-path set or not you can use javac command in the command prompt you will see details options as below:
- That’s it for set path java