Click here to Skip to main content
12,293,547 members (62,960 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 1:10am

1 solution

Rate this: bad
 
good
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
  Permalink  
Comments
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
   
THANKS .DLL STUFF WORKED
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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160518.1 | Last Updated 21 Apr 2012
Copyright © CodeProject, 1999-2016
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