Results 1 to 3 of 3
- 07-19-2010, 11:57 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
Can C++ routines be called from Java program
Hello,
I'm sorry if this is a dumb question, but can C++ code/libraries be called within a Java program?
I'm using Matlab for scientific computing, and a special option may be purchased that outputs an .so file, which can be used as a shared library for standalone C++ code. I wonder if a Java program can access and use such a file?
Matlab provides the ability to port to Java directly but it's another $4000 option that I'd like to avoid if possible using the above scheme.
Thanks in advance, -Gkk
- 07-20-2010, 02:03 AM #2
It's not a dumb question, not whatsoever.
Here's a couple links for you to look at; unfortunately I've never done it myself but these look to be exactly what you need.
Integrating Native Methods into Java Programs
Java Tip 17: Integrating Java with C++ - JavaWorld
How to Access C++ from Java | Javalobby
Best of luck!
- 07-20-2010, 09:43 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Oracle have an oldish tutorial on JNI.
I don't think it's changed significantly since then, but I haven't used it much so can't guarantee.
Similar Threads
-
program terminates itself and leave log file called hr_err_pid in desktop
By rinza in forum New To JavaReplies: 3Last Post: 03-13-2012, 09:28 AM -
called external program does not automatically write file
By nickvandewiele in forum New To JavaReplies: 6Last Post: 02-25-2010, 02:38 PM -
update() gets never called
By flok in forum AWT / SwingReplies: 8Last Post: 10-19-2009, 04:45 PM -
ok so i have to write a program called FourRectanglePrinter
By jcoon3 in forum New To JavaReplies: 0Last Post: 09-22-2009, 07:15 PM -
My constructor not called
By rdtindsm in forum New To JavaReplies: 2Last Post: 09-20-2009, 01:38 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks