1

EDITED:---- I need to batch process a number of processing sketch files from my JavaFX application. The following code, below, works on Windows. I would like to get it running on a Mac, but not sure how.

My workflow is as follows:

//as the user for the processing-java.exe file

processingJavaProrgramFile = fileChooser.showOpenDialog(stage);
if (processingJavaProrgramFile != null) {
    processingJavaProrgramPath = processingJavaProrgramFile.getPath();
}



//ask the user for the processing sketch folder

processingSketchDir = directoryChooser.showDialog(stage);
if (processingSketchDir != null) {
  sketchPath = processingSketchDir.getPath();
}



//java run time exec method to compile sketch in user folder using through processing-java.exe

Runtime.getRuntime().exec(
    processingJavaProrgramPath + 
    " --force --run --sketch=" + 
    sketchPath + "  --output=" + 
    sketchPath+File.separator  +
    "temp"
 );

How do I get it to run on Mac? For one, the Mac version does not have a processing-java.exe. Should it be a different workflow? If so, how do I let the application know whether it is running on a Windows or a Mac OS so that it runs the appropriate method?

melkhaldi
  • 899
  • 2
  • 19
  • 40
  • Post an [MCVE](http://stackoverflow.com/help/mcve) as well as the specific errors you're seeing, and we'll go from there. – Kevin Workman Jul 23 '14 at 12:38

1 Answers1

2

Ok found the solution to both my questions.

To get the OS type, I used method here

To run processing with same code on the mac, I need to:

from processing, go to tools menu and install "processing-java". This install it into the system somehow. So in the Mac case, users do not need to select the path where processing-java is like in Windows (select the processing-java.exe). On the mac, users would only need to select the output folder.

Community
  • 1
  • 1
melkhaldi
  • 899
  • 2
  • 19
  • 40