![]() ![]() ~/NetBeansProjects/NativeApplication/build/classes$ java -cp /Users/name/Downloads/jna-4.1.0.jar. ~/NetBeansProjects/NativeApplication/native$ gcc -dynamiclib -I/System/Library/Frameworks/amework/Headers libViableExampleNative.c -framework JavaVM -o darwin/libViableExampleNative.jnilib ![]() ~/NetBeansProjects/NativeApplication/build/classes$ java -cp /Users/name/Downloads/jna-4.1.0.jar.:/Users/name/NetBeansProjects/NativeApplication/native/ viableexamplejava.ViableExample (Please replace paths with appropriate ones. Notes for building native libs and running Java application from terminal: NetBeans Output Window doesn't emulate a terminal, it just shows process output. I've tried similar scenario using JNI, and it works the same. Printf output will be shown when the native method finishes. The behavior is the same as when running in NetBeans. The output is not displayed in terminal directly, but piped to the less command. Printing of the "printf" output is postponed always if the program is not run directly in terminal. NetBeans is not source of the problem here. User directory: /home/user/.netbeans/8.0.2Ĭache directory: /home/user/.cache/netbeans/8.0.2 System: Linux version 3.13.0-53-generic running on amd64 UTF-8 en_US (nb) Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14 Updates: Updates available to version NetBeans 8.0.2 Patch 2 Priority set to P2 because the only work around, running all Java Native Access applications via the terminal, can be highly impractical. ![]() Can you verify whether this is a Netbeans bug or a bug in JNA? Note that when I run the jar file from the Linux terminal on Ubuntu Linux, printf statements seem to work fine, they only fail to appear in the Netbeans terminal. In the example below, when my Java code calls native code via JNA (Java Native Access), the print statements from the native code are not appearing in the Netbeans terminal and the application appears to stall. ![]()
0 Comments
Leave a Reply. |