Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-2007, 06:56 PM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
java.io.IOException: CreateProcess: matlab error=2
I'm using matlab it is call by a class what its name is "Engine"

I'm working in linux and works fine, I want to know how can I do that with windows.
I found on Internet a class call MatlabControl, that uses all .jar of matlab.
But it gives to me problems when I try to create a matlab object
Code:
try { Process p = Runtime.getRuntime().exec("matlab"); } catch (IOException ex) { ex.printStackTrace(); }
And this is the exception:
Code:
java.io.IOException: CreateProcess: matlab error=2 at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) at java.lang.ProcessImpl.start(ProcessImpl.java:30) at java.lang.ProcessBuilder.start(ProcessBuilder.java:451) at java.lang.Runtime.exec(Runtime.java:591) at java.lang.Runtime.exec(Runtime.java:429) at java.lang.Runtime.exec(Runtime.java:326) at matlab.Main.main(Main.java:32)
Can you help me?

Last edited by Jack : 06-30-2007 at 02:39 AM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-25-2007, 09:33 PM
Member
 
Join Date: Jun 2007
Posts: 1
pgandle is on a distinguished road
solution from java world
CreateProcess error=2, trying to open xml file
When Runtime.exec() won't - Java World

try {
String[] cmd = new String[4];
cmd[0] = "cmd.exe";
cmd[1] = "/C";
cmd[2] = "start";
cmd[3] = "D:\\examples\\invoices\\2-1-20070625061706-ABC.xls";
// cmd[3] = "will.xls";
// cmd[3] = "mailto:";
// cmd[3] = "a.html";
// cmd[3] = "file:/c:/java/temp/a.html";

Process process = Runtime.getRuntime().exec( cmd );
} catch (IOException e) {
e.printStackTrace();
}
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-30-2007, 02:39 AM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
it works!!!
thanks pgandle!
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 10:01 AM
Member
 
Join Date: Apr 2008
Location: India
Posts: 4
avinash.natekar is on a distinguished road
Could you please tell me what cmd[3] is standing for?
cmd[0] is the executable file name I think ... but I ma not getting what cmd[3] is ?? is this for some logging purpose
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, Integrate a Java with Matlab toby Advanced Java 2 08-07-2008 08:08 AM
I need to be able to deal with functions like matlab romina New To Java 1 08-07-2007 06:37 AM
java.io.IOException: invalid header field osval Advanced Java 1 08-07-2007 12:09 AM
error with import java.io.* osval New To Java 4 08-06-2007 10:12 PM
Variable passing, Error: IOException fernando New To Java 3 07-31-2007 03:03 PM


All times are GMT +3. The time now is 07:25 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org