c*******9 发帖数: 6411 | 1 I tried the following java code on MAC, I am able to compile and run, there
is no error message, but the acrobat does not launch the pdf file. I try the
get the exit value for the process, it is 213.
Any ideas why the acrobat does not launch, how to make it work?
thanks..
Runtime runtime = Runtime.getRuntime();
String[] parameters = new String[2];
parameters[0] = "/Applications/Adobe Acrobat 9 Pro/Adobe Acrobat Pro.app/
Contents/MacOs/AdobeAcrobat";
parameters[1] = "/home/test.pdf";
launchedProcess = runtime.exec( parameters ); | X****r 发帖数: 3557 | 2 Try launch it manually from your terminal using the exact same
arguments. Does that work?
there
the
【在 c*******9 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I tried the following java code on MAC, I am able to compile and run, there : is no error message, but the acrobat does not launch the pdf file. I try the : get the exit value for the process, it is 213. : Any ideas why the acrobat does not launch, how to make it work? : thanks.. : Runtime runtime = Runtime.getRuntime(); : String[] parameters = new String[2]; : parameters[0] = "/Applications/Adobe Acrobat 9 Pro/Adobe Acrobat Pro.app/ : Contents/MacOs/AdobeAcrobat"; : parameters[1] = "/home/test.pdf";
| c*******9 发帖数: 6411 | 3 thanks
I try "/Applications/Adobe Acrobat 9 Pro/Adobe Acrobat Pro.app/Contents/
MacOs/AdobeAcrobat" in the command line, it does not give me any error but
the applicaton is not launch, when I get to the MacOs directory and try
AdobeAcrobat, it does launch.
maybe it is the space in the directory. but I am not sure how to work
around. | g*****g 发帖数: 34805 | 4 Try put a "\" before space, and you'll need two for java string.
I don't have any experience with Mac. But on linux I'll always
put the command in a shell script and call the script instead,
more flexible and less error prone.
but
【在 c*******9 的大作中提到】![](/moin_static193/solenoid/img/up.png) : thanks : I try "/Applications/Adobe Acrobat 9 Pro/Adobe Acrobat Pro.app/Contents/ : MacOs/AdobeAcrobat" in the command line, it does not give me any error but : the applicaton is not launch, when I get to the MacOs directory and try : AdobeAcrobat, it does launch. : maybe it is the space in the directory. but I am not sure how to work : around.
| c*******9 发帖数: 6411 | 5 Thanks
I try
"/Applications/Adobe\ Acrobat\ 9\ Pro/Adobe\ Acrobat\ Pro.app/Contents/
MacOs/AdobeAcrobat" in the command line, it complains can not find file or
directory.
also try use \, not working neither...
【在 g*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Try put a "\" before space, and you'll need two for java string. : I don't have any experience with Mac. But on linux I'll always : put the command in a shell script and call the script instead, : more flexible and less error prone. : : but
|
|