I am unable to run a java program from a batch file that i created.spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.What should I do to get the output?
try java -cp <classpath here> <fully qualified class name>
Venkat Suryadevara
Greenhorn
Joined: May 12, 2003
Posts: 9
posted
0
I am trying to run the same program from my webserver but I am unable to capture the output. what should I do to get that? echo ^<html^>^<body^> echo hello^<br^> setlocal set JDK=C:\j2sdk1.4.1_01 PATH=%JDK%\bin;.;%PATH% set CLASSPATH=%JDK%\jre\lib\*.jar;.;%JDK%\jre\lib\ext\*.jar;.;%CLASSPATH% echo there goes the java file ^<BR^> java -cp c:\j2sdk1.4.1_01\jre\lib*.jar;c:\j2sdk1.4.1_01\bin; spiderpackage.EntryPoint -v echo passed it endlocal echo ^</body^>^</html^>
Venkat Suryadevara
Greenhorn
Joined: May 12, 2003
Posts: 9
posted
0
thanks for a solution.but... I am calling the batch file from my web server.The solution you gave is working when I run the same program from cmd prompt but It's not working when I try to run from my webserver.Please help
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Would this be a UNIX web server? Wouldn't you need a .sh file for that?
"JavaRanch, where the deer and the Certified play" - David O'Meara
Venkat Suryadevara
Greenhorn
Joined: May 12, 2003
Posts: 9
posted
0
no..it's windows web server....
Doanh Nguyen
Ranch Hand
Joined: Dec 02, 2000
Posts: 45
posted
0
Originally posted by Venkat Suryadevara: I am unable to run a java program from a batch file that i created.spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.What should I do to get the output?
I think a web page, i.e., IE, runs in the windows operating system whereas a batch file runs in its dos-like address space, which accommodates JVM to run your java class. I am not sure if direct communication between these two address spaces is possible. You may want to modify your Java program to write to a file...
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
I am a little confused here. Are you trying to run a client application (what I had in mind when I was talking to you), or a Servlet, or what?
Venkat Suryadevara
Greenhorn
Joined: May 12, 2003
Posts: 9
posted
0
I am making the question very clear. I have a batch file.It calls a java program call java myprogram.java I am running this batch file from CGI of the web server.I am unable to see the output