1

I am using JPL, a JNI library for interacting with Prolog from Java. In my application it is important to see the output that the Prolog engine generates (for example: when loading Prolog files, executing unit tests, etc). This is happening when I use the library in a standalone Java application.

However, when I pack my application as an Eclipse plug-in, I cannot see the JPL generated output anymore (such output is coming from the Prolog engine).

Does someone know if there is a way to see this output in the Eclipse console?

Thanks in advance.

Sergio
  • 8,532
  • 11
  • 52
  • 94
  • Check out this one: http://stackoverflow.com/questions/4008675/how-can-i-redirect-jni-console-output-to-eclipse-console-view-when-eclipse-plug – Martti Käärik Dec 07 '11 at 07:33
  • Thanks for the link @vanaprogeja, unfortunately I do not have control over the JNI library I am using, conversely to the scenery of the question in the link. So I do not think I could use freopen as someone suggested. – Sergio Dec 07 '11 at 08:34

1 Answers1

0

May be you could try to make a plugin out of your library (hwoto) and then hook a LogListener for this plugin (like that)?

Alex K.
  • 3,294
  • 4
  • 29
  • 41
  • thanks for your answer @Alexander. If I understood correctly the link proposes a mechanism for capturing log events and processing them afterwards (?) .Unfortunately, in my case I do not have proper log events, just output generated to the stdio from my JNI library. – Sergio Dec 07 '11 at 18:23
  • But can you still try to create a plugin out of a library, may be in this case you will see the output? – Alex K. Dec 07 '11 at 21:02
  • mmm, not sure if I get your point. My application is already an eclipse plug-in, and I do not see the output when deployed as a jar file dropped in the plugins folder (I can see the output if I choose "Run as/Eclipse Application" from the development environment). I do not think it will make a difference if I have two plugins instead (one with the library and one with the rest of the application) as I understand you suggest (?) – Sergio Dec 07 '11 at 21:20
  • Are you running it with -consoleLog/-debug argument? – Alex K. Dec 08 '11 at 10:24