views:

41

answers:

0

Greetings, I have an Eclipse plugin (A) which has a dependency on another plugin (B). Plugin B is simply a wrapper around a jar, which contains a native dll, and performs jni functionality. Given this setup, I have the following code in A's Activator class's start method:

MessageConsole jniConsole = new MessageConsole("Opereffa Output", null); ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { jniConsole }); ConsolePlugin.getDefault().getConsoleManager().showConsoleView(jniConsole); MessageConsoleStream stream = jniConsole.newMessageStream(); System.setOut(new PrintStream(stream)); System.setErr(new PrintStream(stream));

When plugin A performs its functionality, any use of System.out actually goes to the console within Eclipse. But native code used by JNI also writes to output stream, which I can't grab. During development, output from JNI goes to the console of the Eclipse instance which has launched the running instance, which contains the plugins.

So how do I grab the JNI output and display in the console?

Best Regards

Seref