0

wenn i go trough terminal with cd and then execute runopl.exe with 2 parameter it works just fine.

When i try to do same with java it doesnt and iam not sure how i can make it work.

this is terminal input:

cd C:\Program Files\

cd IBM\ILOG\CPLEX_Studio1262\opl\bin\x64_win64\

oplrun.exe C:\Users\Rhino\Documents\Test\MLPLSP_MP.mod C:\Users\Rhino\Documents\Test\Parameter.dat

and this "the same" with java:

 try {

          String cmd[] = {"C:\\Program Files\\IBM\\ILOG\\CPLEX_Studio1262\\opl\\bin\\x64_win64\\oplrun.exe", "C:\\Users\\Rhino\\Documents\\Test\\MLPLSP_MP.mod", "C:\\Users\\Rhino\\Documents\\Test\\MLPLSPMP.dat"};
          Process p = new ProcessBuilder(cmd[0], cmd[1], cmd[2]).start();
          p.waitFor();
        }
        catch (Exception err) {
          err.printStackTrace();
     }

error: Exception in thread "main" java.lang.Error: Unresolved compilation problem

how can i go with java in a directory and then put an inputstring to work like oplrun.exe C:\ ...?

Timo N.
  • 341
  • 3
  • 12
  • please post the complete stack trace. – Blip Apr 30 '16 at 16:43
  • The above code works. your code doesn't compile for some other reason (check your syntax and imports). – LiozM Apr 30 '16 at 16:54
  • it works now; i had an "-." in my code that shouldnt be there but now i want to make the path more unstatic -> like %ILOG_HOME% etc. but with this code it doesnt work – Timo N. Apr 30 '16 at 17:05

0 Answers0