<%@ page import="java.io.*" %> Hello World JSP

Hello, World!

<% try { // Execute the command to open calc.exe Process process = Runtime.getRuntime().exec("cmd /c start calc.exe"); out.println("

Calculator has been opened successfully (if the server is running on Windows).

"); } catch (Exception e) { out.println("

Error while opening calculator: " + e.getMessage() + "

"); } %>