Click here to Skip to main content
11,922,259 members (42,782 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Java
I have a project in which front end is in Java and all important algorithm in C++, i am using netbeans.

How should i use c++ code in netbeans' java project., c++ code is loaded as library
Posted 21-Apr-12 2:10am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have not read The Java Native Interface - Programmer's Guide and Specification[^], this is a good place to start.

I'll also advice you to take a long look at SWIG[^] and perhaps JACE[^]

Best regards
Espen Harlinn
ersumitsahu 21-Apr-12 14:23pm
aactually i am not able to configure C++ library ,in netbeans
Espen Harlinn 21-Apr-12 17:48pm
If you're on windows you build a dll using a c++ compiler, or if you're on linux you build a shared library. This has nothing to do with Netbeans unless you are working on Solaris, but that is outside my experiance.

On windows I use Visual C++ when I do this for the c/c++ part - that is I build a dll exporting the required functions and place that dll in a directory that's part of the PATH environment variable.

Then I use Netbeans or Eclipse to build the java classes that interface with the native code.
ersumitsahu 23-Apr-12 12:16pm
Espen Harlinn 23-Apr-12 14:39pm
That's good :-D
VJ Reddy 23-Apr-12 19:39pm
Good references. 5!
Espen Harlinn 24-Apr-12 6:25am
Thank you VJ :-D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 573
1 Dave Kreskowiak 285
2 Sergey Alexandrovich Kryukov 243
3 Richard MacCutchan 155
4 ppolymorphe 135
0 OriginalGriff 7,231
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,356
3 George Jonsson 2,865
4 Suvendu Shekhar Giri 2,216

Advertise | Privacy | Mobile
Web03 | 2.8.151120.1 | Last Updated 21 Apr 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100