Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 133692

Summary: Help Java projects with JNI support
Product: cnd Reporter: Vladimir Voskresensky <vv159170>
Component: -- Other --Assignee: petrk
Status: NEW --- QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: gtzabari
Version: 6.x   
Target Milestone: 6.x   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: ENHANCEMENT Exception Report:

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. ***
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo