I am trying to use the method Runtime.getRuntime().exec in a servlet.But there seems to be a path problem as it is giving IO exception.I have given path related to the servlet.What mistake am I doing ??
Thanx & Regards Anurag Bhalla Project Trainee Usha Martin Infotech Ltd. 63,Udyog Vihar phase- IV Gurgaon, Haryana Ph. No - 6398071-78 Ext - 466
"anuragbhalla", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements. Thanks.
Your problem is probably because you are expecting the "current directory" to be set to something in particular. Servlet containers are free to set the "current directory" to whatever they linke, so you should always either use an absolute path for all executables and files you access from a servlet, or implement some way of deciding where to look (servletContext.getRealPath(), an init parameter or whatever).