开发者

File Not found exception in opening a jar file after i make the jar file using command line arguments

开发者 https://www.devze.com 2023-03-29 16:42 出处:网络
The problem statement: I have a J2ME app and i have a separate struts program running. The program automatically changes the source of the J2ME app an then builds it, pre-verify it, and then package

The problem statement:

I have a J2ME app and i have a separate struts program running. The program automatically changes the source of the J2ME app an then builds it, pre-verify it, and then package it using command line arguments. To achieve all this i have used "Runtime.getRuntime().exec" in my program. Problem is that if i introduce a delay of one sec before the command for packaging is executed, the jar file is still formed BUT accessing the jar file using the command "DataInputStream in = new DataInputStream(new FileInputStream(f));" gives me File Not found exception. "f" is the path to the jar file and i have checked it using "f.getCanonicalPath()" that its t开发者_如何转开发he right path.

I don know what the problem is. Please help me. I thank you in advance.


Are you waiting for the Process spawned by Runtime.exec() to complete before accessing the jar file? You can use Process.waitFor() for instance to halt the execution of your thread.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号