开发者

Air NativeProcess java

开发者 https://www.devze.com 2023-04-11 19:12 出处:网络
I want to interact with a .jar-file in my AIR-project. I am using the NativeProcess feature in AIR2 for this, but it seems like I can\'t just define \'myJavaFile.jar\' as the executable.

I want to interact with a .jar-file in my AIR-project. I am using the NativeProcess feature in AIR2 for this, but it seems like I can't just define 'myJavaFile.jar' as the executable.

On Windows, you can give 'java.exe' as the executable, the problem is Mac can't handle .exe-files.

So my question is: how can I use .jar-files with the NativeProcess feature in AIR2. Or maybe there is an other solution to 开发者_StackOverflow中文版communicate with a .jar-files in AIR / AS3?

Many thanks in advance!


I figured it out. You can use var file:File = new File("/usr/bin/java"); and pass parameters to the Java-file with a Vector of arguments. E.g.

var arguments:Vector.<String> = new Vector.<String>;
arguments.push("-jar");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号