Question

How do you use this great new API in connection with Java? Do you use just pure native process API like nativeProcess.standardInput.write() and nativeProcess.standardOutput.read() with which you cannot debug Java side neither invoke remote java method. Or you are using some library that leverages remote method invocation such as flerry lib but that also cannot debug Java side? Or maybe you are using Merapi with which you can debug but cannot remotely invoke Java method? I'm asking this because this is maybe the most important question regarding this API and its ease of use.

No correct solution

OTHER TIPS

It sounds like your reservations have to do with being able to debug the Java process. This is not really an issue. You can use the NativeProcess API to kick off a Java process with arguments that will cause it to be externally debuggable. For example:

var processArgs:Vector.<String> = new Vector.<String>();   
processArgs.push("-Xdebug");  
processArgs.push("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n");  

This will allow your Java process to be remote debuggable. You can then connect to it from Eclipse or Netbeans once the process has started. If the code in the Java process is linked to an active Eclipse/Netbeans project, you can do linewise debugging like you would of any other Java application.

-Raj

You can use NativeProcess to execute java.exe and pass it the right parameters to execute a java application.

You cannot use NativeProcess to run random java code from a jar file.

Having used both of them, you can debug the JVM with MerAPI or NativeProcess API. Prior to AIR2.0, I used merapi to communicate over the network to a java process.

I would much prefer to use the NativeProcess launcher now, with MerAPI we were hacking ugly marshalling code. Debugging the network payloads was a pin via merapi.

Using NativeProcess API is easy -

var myForkedExe:NativeProcessStartupInfo = new NativeProcessStartupInfo(); myForkedExe.executable = ; ...

I am not sure I understand what you mean by can not invoke remote Java methods with merapi. That's exactly what I have been doing. Debugging is easy, just set the JPDA args and attach any JAVA debugger.

You could use Flerry to launch and communicate with java processes.

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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top