Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Executing notepad in jsp (WIndows 2000)

843835Nov 22 2002 — edited Nov 26 2002
Hey,

I've been playing around with the Runtime API and have run into problem. I want to eventually run a C program through a JSP page, but I can't even get notepad to open successfully. Below is the entire test code that is supposed to open notepad. When I open this JSP page in Windows 2000, nothing happens. The GUI for notepad is never opened. However, I checked the task manager and there is an instance of notepad there, and when I try to end the process it gives me an error saying that access is denied. I wrote a simple java program with similar code, and I am able to successfully open notepad through it. I can't see what I'm doing wrong here. Anyone else have this problem on Windows 2000? Thanks.

<%@ page import="java.io.*" %>
<%
Runtime r = Runtime.getRuntime();
try {
Process p = r.exec("notepad");
} catch (Exception e) {
System.out.println("Error");
}
%>
<html>
...html code...
</html>

Jason



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2002
Added on Nov 22 2002
2 comments
105 views