Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 133692 - Help Java projects with JNI support
Help Java projects with JNI support
Status: NEW
Product: cnd
Classification: Unclassified
Component: -- Other --
6.x
All All
: P3 with 2 votes (vote)
: 6.x
Assigned To: petrk
issues@cnd
:
: 88654 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-22 16:58 UTC by Vladimir Voskresensky
Modified: 2014-09-22 14:41 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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