• Post Reply Bookmark Topic Watch Topic
  • New Topic

Process process = Runtime.getRuntime().exec()  RSS feed

 
Tommy Leung
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need to run a java file which located in local directory, but not under webapp

The local directory is C:/search, the java class file is Gen_Show_Pic.class and Gen_Show_Pic.java

I added C:/search to classpath and path in environmental variables

The servlet code is below:

The program hanged after running it.

If I run the command in cmd mode, it will generate a file with file name '10' under C:/search/test folder.

How should I work with the code?

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by reading this article. It explains everything you need to look out for when using Runtime.exec.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!