This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running external executable from java

 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to execute an external exe from java. For this I have used an intermediate bat file and through the bat file I am executing the exe. This works fine and I get my expected results. But I have issues in this approach when executing this file under User Account Control (UAC). In Windows Vista and Windows 7 when UAC enable this take some time to execute. Also when the external exe file becomes large the time taken to execute keeps on increasing (For a 200 MB file it takes 15-20 second delay to pop up with executable). So is there any alternative solution to this approach? Also if its a .net soluton will I encounter the same issue?

Thank you
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are executing a bat file, there is no reason to think that Java has anything to do with the delay.

Presumably you are providing for handing the stdOut and stdErr streams as described in the java.lang.Process JavaDocs.

Bill
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you William for your reply.

But why is this happen in java applications. A solution like .net does not encounter such performance issues. So I suspect this has something to do with java. Any ideas?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps there is a low memory condition and the operating system is spending time paging your Java program memory in and out?

If this was my problem I would try monitoring CPU use and memory paging etc. - how much memory are you working with and how much does your Java program use?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic