-
runtime.exec()
I have chosen to use a very simple solution to a simple problem but
it doesnt work.
I have a web application that creates an XML file from a submitted form and
all the rest, i have a simple java application which should allow the user
to browse the file system and find the xml file and then be able to render
that xml as html and show it in a browser.
I am trying to use Runtime.exec() as this:
String filePath; // this is the file path as returned from the JFilechooser
Runtime rt = Runtime.getRuntime();
rt.exec(filepath,null);
this is the error message that i get:
java.io.IOException: CreateProcess:
*** the file path here ***** error=193
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112)
at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
at jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
doesnt matter what i try to execute i get a similar sort of error.
I have never used exec() but i have used the equivalent of this in C++ without
having any problem.
Any idea what am i doing wrong???
Seb
-
Re: runtime.exec()
Paul,
Thanks for the reply,the second parameter is for the environment variable,
i tried almost every thing i could think of. I even tried simple things like
this
rt.exec("dir");
to see if it recognises dos commands but still getting the same error.
"Paul Clapham" <pclapham@core-mark.com> wrote:
>What's with the "null" for the second parameter?
>
>PC2
>
>"Seb" <seb@hotmail.com> wrote in message news:3c04e670$1@147.208.176.211...
>>
>> I have chosen to use a very simple solution to a simple problem but
>> it doesnt work.
>> I have a web application that creates an XML file from a submitted form
>and
>> all the rest, i have a simple java application which should allow the
user
>> to browse the file system and find the xml file and then be able to render
>> that xml as html and show it in a browser.
>> I am trying to use Runtime.exec() as this:
>> String filePath; // this is the file path as returned from the
>JFilechooser
>> Runtime rt = Runtime.getRuntime();
>> rt.exec(filepath,null);
>>
>> this is the error message that i get:
>>
>> java.io.IOException: CreateProcess:
>> *** the file path here ***** error=193
>> at java.lang.Win32Process.create(Native Method)
>> at java.lang.Win32Process.<init>(Unknown Source)
>> at java.lang.Runtime.execInternal(Native Method)
>> at java.lang.Runtime.exec(Unknown Source)
>> at java.lang.Runtime.exec(Unknown Source)
>> at java.lang.Runtime.exec(Unknown Source)
>> at
>jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112
>)
>> at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
>> at
>jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
>> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>> at
>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
>> Source)
>> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>Source)
>> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>> at
>javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
>> Source)
>> at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
>> at java.awt.Component.processMouseEvent(Unknown Source)
>> at java.awt.Component.processEvent(Unknown Source)
>> at java.awt.Container.processEvent(Unknown Source)
>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>> at java.awt.Component.dispatchEvent(Unknown Source)
>> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
>Source)
>> at java.awt.LightweightDispatcher.processMouseEvent(Unknown
>Source)
>> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>> at java.awt.Window.dispatchEventImpl(Unknown Source)
>> at java.awt.Component.dispatchEvent(Unknown Source)
>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
>> Source)
>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>Source)
>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>> at java.awt.EventDispatchThread.run(Unknown Source)
>>
>> doesnt matter what i try to execute i get a similar sort of error.
>> I have never used exec() but i have used the equivalent of this in C++
>without
>> having any problem.
>>
>> Any idea what am i doing wrong???
>>
>> Seb
>
>
-
Re: runtime.exec()
Sorted now. Who ever needs to use this, you need to use some pre-historic
dos commands, ie something like this:
String [] cmd = new String [3];
cmd[0] = "cmd.exe";
cmd [1] = "/c" // this is the trick, it means execute what follows
cmd[2] = "fileName.ext";
rt.exec(cmd);
"Seb" <seb@hotmail.com> wrote:
>
>Paul,
>Thanks for the reply,the second parameter is for the environment variable,
>i tried almost every thing i could think of. I even tried simple things
like
>this
>
>rt.exec("dir");
>
>to see if it recognises dos commands but still getting the same error.
>
>"Paul Clapham" <pclapham@core-mark.com> wrote:
>>What's with the "null" for the second parameter?
>>
>>PC2
>>
>>"Seb" <seb@hotmail.com> wrote in message news:3c04e670$1@147.208.176.211...
>>>
>>> I have chosen to use a very simple solution to a simple problem but
>>> it doesnt work.
>>> I have a web application that creates an XML file from a submitted form
>>and
>>> all the rest, i have a simple java application which should allow the
>user
>>> to browse the file system and find the xml file and then be able to render
>>> that xml as html and show it in a browser.
>>> I am trying to use Runtime.exec() as this:
>>> String filePath; // this is the file path as returned from the
>>JFilechooser
>>> Runtime rt = Runtime.getRuntime();
>>> rt.exec(filepath,null);
>>>
>>> this is the error message that i get:
>>>
>>> java.io.IOException: CreateProcess:
>>> *** the file path here ***** error=193
>>> at java.lang.Win32Process.create(Native Method)
>>> at java.lang.Win32Process.<init>(Unknown Source)
>>> at java.lang.Runtime.execInternal(Native Method)
>>> at java.lang.Runtime.exec(Unknown Source)
>>> at java.lang.Runtime.exec(Unknown Source)
>>> at java.lang.Runtime.exec(Unknown Source)
>>> at
>>jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112
>>)
>>> at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
>>> at
>>jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
>>> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>> at
>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
>>> Source)
>>> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>>Source)
>>> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>> at
>>javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
>>> Source)
>>> at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
>>> at java.awt.Component.processMouseEvent(Unknown Source)
>>> at java.awt.Component.processEvent(Unknown Source)
>>> at java.awt.Container.processEvent(Unknown Source)
>>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
>>Source)
>>> at java.awt.LightweightDispatcher.processMouseEvent(Unknown
>>Source)
>>> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>> at java.awt.Window.dispatchEventImpl(Unknown Source)
>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
>>> Source)
>>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>>Source)
>>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>> at java.awt.EventDispatchThread.run(Unknown Source)
>>>
>>> doesnt matter what i try to execute i get a similar sort of error.
>>> I have never used exec() but i have used the equivalent of this in C++
>>without
>>> having any problem.
>>>
>>> Any idea what am i doing wrong???
>>>
>>> Seb
>>
>>
>
-
Re: runtime.exec()
What's with the "null" for the second parameter?
PC2
"Seb" <seb@hotmail.com> wrote in message news:3c04e670$1@147.208.176.211...
>
> I have chosen to use a very simple solution to a simple problem but
> it doesnt work.
> I have a web application that creates an XML file from a submitted form
and
> all the rest, i have a simple java application which should allow the user
> to browse the file system and find the xml file and then be able to render
> that xml as html and show it in a browser.
> I am trying to use Runtime.exec() as this:
> String filePath; // this is the file path as returned from the
JFilechooser
> Runtime rt = Runtime.getRuntime();
> rt.exec(filepath,null);
>
> this is the error message that i get:
>
> java.io.IOException: CreateProcess:
> *** the file path here ***** error=193
> at java.lang.Win32Process.create(Native Method)
> at java.lang.Win32Process.<init>(Unknown Source)
> at java.lang.Runtime.execInternal(Native Method)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at
jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112
)
> at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
> at
jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
> Source)
> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
> Source)
> at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
> at java.awt.Component.processMouseEvent(Unknown Source)
> at java.awt.Component.processEvent(Unknown Source)
> at java.awt.Container.processEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
> at java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
>
> doesnt matter what i try to execute i get a similar sort of error.
> I have never used exec() but i have used the equivalent of this in C++
without
> having any problem.
>
> Any idea what am i doing wrong???
>
> Seb
-
Re: runtime.exec()
Hello seb,
the error code rt.exec return means:
193 %1 is not a valid Win32 application. ERROR_BAD_EXE_FORMAT
according to the Win SDK Help, The first parameter of rt.exec has to
be an executable file like an *.exe. "Dir" does not work because it is'nt
an executable either. The Executable for the "dir" command is the command
interpreter 'cmd.exe' on NT.
In your case you have to supply your browser as the executable and your
xml file as the paramater for it.
grettings from germany
werner
"Seb" <seb@hotmail.com> wrote:
>
>I have chosen to use a very simple solution to a simple problem but
>it doesnt work.
>I have a web application that creates an XML file from a submitted form
and
>all the rest, i have a simple java application which should allow the user
>to browse the file system and find the xml file and then be able to render
>that xml as html and show it in a browser.
>I am trying to use Runtime.exec() as this:
>String filePath; // this is the file path as returned from the JFilechooser
>Runtime rt = Runtime.getRuntime();
>rt.exec(filepath,null);
>
>this is the error message that i get:
>
>java.io.IOException: CreateProcess:
>*** the file path here ***** error=193
> at java.lang.Win32Process.create(Native Method)
> at java.lang.Win32Process.<init>(Unknown Source)
> at java.lang.Runtime.execInternal(Native Method)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112)
> at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
> at jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
>Source)
> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
>Source)
> at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
> at java.awt.Component.processMouseEvent(Unknown Source)
> at java.awt.Component.processEvent(Unknown Source)
> at java.awt.Container.processEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
> at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
>Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
>
>doesnt matter what i try to execute i get a similar sort of error.
>I have never used exec() but i have used the equivalent of this in C++ without
>having any problem.
>
>Any idea what am i doing wrong???
>
>Seb
-
Re: runtime.exec()
This is a classic example of not paying enough attention to the API. It clearly
states that the runtime exec is not a command line! Therefore why are you
using it as such! The solution given below is a more correct response to
the solution, since now the command engine we require is now being supplied.
Please review the API more closely, as there are a few more ghosts lurking
in the closet. Also, pay attention to paths, try using the full pathname
for programs like netscape rather than just "netscape.exe".
"Seb" <seb@hotmail.com> wrote:
>
>Sorted now. Who ever needs to use this, you need to use some pre-historic
>dos commands, ie something like this:
>String [] cmd = new String [3];
>cmd[0] = "cmd.exe";
>cmd [1] = "/c" // this is the trick, it means execute what follows
>cmd[2] = "fileName.ext";
>rt.exec(cmd);
>
>"Seb" <seb@hotmail.com> wrote:
>>
>>Paul,
>>Thanks for the reply,the second parameter is for the environment variable,
>>i tried almost every thing i could think of. I even tried simple things
>like
>>this
>>
>>rt.exec("dir");
>>
>>to see if it recognises dos commands but still getting the same error.
>>
>>"Paul Clapham" <pclapham@core-mark.com> wrote:
>>>What's with the "null" for the second parameter?
>>>
>>>PC2
>>>
>>>"Seb" <seb@hotmail.com> wrote in message news:3c04e670$1@147.208.176.211...
>>>>
>>>> I have chosen to use a very simple solution to a simple problem but
>>>> it doesnt work.
>>>> I have a web application that creates an XML file from a submitted form
>>>and
>>>> all the rest, i have a simple java application which should allow the
>>user
>>>> to browse the file system and find the xml file and then be able to
render
>>>> that xml as html and show it in a browser.
>>>> I am trying to use Runtime.exec() as this:
>>>> String filePath; // this is the file path as returned from the
>>>JFilechooser
>>>> Runtime rt = Runtime.getRuntime();
>>>> rt.exec(filepath,null);
>>>>
>>>> this is the error message that i get:
>>>>
>>>> java.io.IOException: CreateProcess:
>>>> *** the file path here ***** error=193
>>>> at java.lang.Win32Process.create(Native Method)
>>>> at java.lang.Win32Process.<init>(Unknown Source)
>>>> at java.lang.Runtime.execInternal(Native Method)
>>>> at java.lang.Runtime.exec(Unknown Source)
>>>> at java.lang.Runtime.exec(Unknown Source)
>>>> at java.lang.Runtime.exec(Unknown Source)
>>>> at
>>>jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112
>>>)
>>>> at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
>>>> at
>>>jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
>>>> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>>> at
>>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
>>>> Source)
>>>> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>>>Source)
>>>> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>>> at
>>>javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
>>>> Source)
>>>> at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
>>>> at java.awt.Component.processMouseEvent(Unknown Source)
>>>> at java.awt.Component.processEvent(Unknown Source)
>>>> at java.awt.Container.processEvent(Unknown Source)
>>>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>>> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
>>>Source)
>>>> at java.awt.LightweightDispatcher.processMouseEvent(Unknown
>>>Source)
>>>> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Window.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>>> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
>>>> Source)
>>>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>>>Source)
>>>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>>> at java.awt.EventDispatchThread.run(Unknown Source)
>>>>
>>>> doesnt matter what i try to execute i get a similar sort of error.
>>>> I have never used exec() but i have used the equivalent of this in C++
>>>without
>>>> having any problem.
>>>>
>>>> Any idea what am i doing wrong???
>>>>
>>>> Seb
>>>
>>>
>>
>
-
Re: runtime.exec()
Runtime.getRuntime().exec("cmd /c dir") also works 
"Seb" <seb@hotmail.com> wrote:
>
>Sorted now. Who ever needs to use this, you need to use some pre-historic
>dos commands, ie something like this:
>String [] cmd = new String [3];
>cmd[0] = "cmd.exe";
>cmd [1] = "/c" // this is the trick, it means execute what follows
>cmd[2] = "fileName.ext";
>rt.exec(cmd);
>
>"Seb" <seb@hotmail.com> wrote:
>>
>>Paul,
>>Thanks for the reply,the second parameter is for the environment variable,
>>i tried almost every thing i could think of. I even tried simple things
>like
>>this
>>
>>rt.exec("dir");
>>
>>to see if it recognises dos commands but still getting the same error.
>>
>>"Paul Clapham" <pclapham@core-mark.com> wrote:
>>>What's with the "null" for the second parameter?
>>>
>>>PC2
>>>
>>>"Seb" <seb@hotmail.com> wrote in message news:3c04e670$1@147.208.176.211...
>>>>
>>>> I have chosen to use a very simple solution to a simple problem but
>>>> it doesnt work.
>>>> I have a web application that creates an XML file from a submitted form
>>>and
>>>> all the rest, i have a simple java application which should allow the
>>user
>>>> to browse the file system and find the xml file and then be able to
render
>>>> that xml as html and show it in a browser.
>>>> I am trying to use Runtime.exec() as this:
>>>> String filePath; // this is the file path as returned from the
>>>JFilechooser
>>>> Runtime rt = Runtime.getRuntime();
>>>> rt.exec(filepath,null);
>>>>
>>>> this is the error message that i get:
>>>>
>>>> java.io.IOException: CreateProcess:
>>>> *** the file path here ***** error=193
>>>> at java.lang.Win32Process.create(Native Method)
>>>> at java.lang.Win32Process.<init>(Unknown Source)
>>>> at java.lang.Runtime.execInternal(Native Method)
>>>> at java.lang.Runtime.exec(Unknown Source)
>>>> at java.lang.Runtime.exec(Unknown Source)
>>>> at java.lang.Runtime.exec(Unknown Source)
>>>> at
>>>jsp.gui.SubmissionBrowser.jButton1ActionPerformed(SubmissionBrowser.java:112
>>>)
>>>> at jsp.gui.SubmissionBrowser.access$100(SubmissionBrowser.java:16)
>>>> at
>>>jsp.gui.SubmissionBrowser$2.actionPerformed(SubmissionBrowser.java:57)
>>>> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>>> at
>>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
>>>> Source)
>>>> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>>>Source)
>>>> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>>> at
>>>javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
>>>> Source)
>>>> at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
>>>> at java.awt.Component.processMouseEvent(Unknown Source)
>>>> at java.awt.Component.processEvent(Unknown Source)
>>>> at java.awt.Container.processEvent(Unknown Source)
>>>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>>> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
>>>Source)
>>>> at java.awt.LightweightDispatcher.processMouseEvent(Unknown
>>>Source)
>>>> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Window.dispatchEventImpl(Unknown Source)
>>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>>> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
>>>> Source)
>>>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>>>Source)
>>>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>>> at java.awt.EventDispatchThread.run(Unknown Source)
>>>>
>>>> doesnt matter what i try to execute i get a similar sort of error.
>>>> I have never used exec() but i have used the equivalent of this in C++
>>>without
>>>> having any problem.
>>>>
>>>> Any idea what am i doing wrong???
>>>>
>>>> Seb
>>>
>>>
>>
>
-
How to make Runtime.exec platform independent
Hi ,
I have the following code which runs fine in windows,
String[] cmd = {"cmd", "/c", "dir"};
Process proc = Runtime.getRuntime().exec(cmd);
How can I update this one to run the same code in windows, unix and linux.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|