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;)

setpath

  • To test if class-path set or not you can use javac command in the command prompt you will see details options as below:

setpath2

  • That’s it for set path java

Leave a Reply

Your email address will not be published. Required fields are marked *