Hi..I am getting the "Terminated error" while executing the program. What is this error for? | Core Java Forum
naveen Posted on 21/04/2020

Please find the attached screen shot.

Yogesh Chawla Replied on 21/04/2020

Your program executed successfully with the correct output. This happened because we are using javaw.exe first instead of java.exe.

Set the environment variable in your windows as well.

You can follow these steps to set up environment variable.


Setting Up the Path for Windows

Assuming you have installed Java in c:\Program Files\java\jdk directory −

  • Right-click on 'My Computer' and select 'Properties'.

  • Click the 'Environment variables' button under the 'Advanced' tab.

  • Now, alter the 'Path' variable so that it also contains the path to the Java executable. Example, if the path is currently set to 'C:\WINDOWS\SYSTEM32', then change your path to read 'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.