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 - Help Java projects with JNI support
Summary: Help Java projects with JNI support
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: petrk
: 88654 (view as bug list)
Depends on:
Reported: 2008-04-22 16:58 UTC by Vladimir Voskresensky
Modified: 2014-09-22 14:41 UTC (History)
1 user (show)

See Also:
Exception Reporter:


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 {
        } catch (Exception e) {

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. ***