This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 133692

Summary: Help Java projects with JNI support
Product: cnd Reporter: Vladimir Voskresensky <vv159170>
Component: -- Other --Assignee: petrk
Status: NEW ---    
Severity: blocker CC: gtzabari
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Vladimir Voskresensky 2008-04-22 16:58:26 UTC
I've got some experience on creating JNI methods and have some feedback till not forgot what was uncomfortable :-)

Expected user scenario and user view:
- I have method in Java Editor
public static native int reparentGdkWindow(long childGdk, long parentX11);
- press right button and choose 
"generate JNI impl"
- IDE propose to create "New C++ JNI project (Dynamic Library)" or add to existing dynamic library if any is already opened
- C++ JNI project must be setup with preconfigured include paths to resolve correctly
#include <jni.h> 
- the method with correct signature must be added to file of C++ JNI project, like:
JNIEXPORT jint JNICALL Java_javagnome_WindowUtils_reparentGdkWindow(JNIEnv* env, jclass clazz, jlong childGdk, jlong
parentX11) {
}
- Java project must be updated to have visible generated library *.so file at runtime, i.e. by setting the dependency on
*.so library
- Java file should be updated to have section of library loading, like
    static {
        try {
            System.loadLibrary("GdkUtils");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Module with JNI support should be activated when Java and C++ are enabled
Comment 1 Alexey Vladykin 2009-11-18 06:16:12 UTC
*** Bug 88654 has been marked as a duplicate of this bug. ***