Is it possible to call Java code from a native application? [duplicate] - java

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
how to call java function from c++?
Can C++ call Java code?
I have a native application on Linux (i.e. main() is in C++) and I want to reuse some of my Java code.
Can I load JVM libraries and somehow call Java classes?
Thank you!

You can load the JVM in your native application and invoke stuff using the Invocation API

Related

calling C functions in java [duplicate]

This question already exists:
Can I use a api written in C with java web service [duplicate]
Closed 9 years ago.
I have a tool kit which is written in C. I want to make a java web service which will use this toolkit. how can I do that. how can I call the functions of this toolkit
If the toolkit gives outputs, can you just take the outputs and pipe them?
If not, I think it'd just be easier to convert it yourself, unless pointers are involved.
Otherwise,
http://java.sun.com/docs/books/jni/html/start.html#769

Can we program a burner software like Nero in JAVA only,... HOW? [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Reading and Writing to a DVD/CD - Java
Is possible to build/code a burner software like Nero in JAVA Only ? ... How do that ?
That's will be great if it's possible !!
Thank you
No. Java does not have direct access to the hardware from pure Java code. You'd have to use native code loaded via JNI calls.

Calling java from php [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Call Java method from PHP5
How can I call a java application from a php application, taking note that they reside on the same server?
No WebServices or any http stuff.
Can I do that and how can I do it?
You can use php's exec(...) function to call java on the command line.

Check if screensaver is active [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to determine if a screensaver is running in Java?
is there any way you can find out if the screensaver is active with java? I've searched the web but the only things I found was very complicated native code... My program is made for windows only.
Java cannot handle system tasks directly.
You should use JNI (Java Native Interface) or JNA (Java Native Access) to do it.
I haven't tried this code, but they claim to answer your question with JNA as Ammar suggested: Screen Saver State.

Can i access c++ or Java functions inside python [duplicate]

This question already has answers here:
Calling C/C++ from Python? [closed]
(12 answers)
Closed 11 months ago.
I am mainly using python for extensive algorithms operations. Now i have my webiste in Django.
I few libraries in c++ and few in Java which i don't have in python. Or you can say that i already have some c++ , Java files in which some algorithm is coded.
can i call those function or do some calculation in my djnago sites using those c++ or java files
For C++, certainly. Either write a module that wraps the library, or use something like ctypes or SWIG.
For Java, you'd be best to move to Jython (and correspondingly use django-jython).
Note that using both C++ and Java from Python is not trivial.
I've used Boost.Python to some degree of success for accessing C++ libraries within Python/Django.
You could check the http://www.scipy.org/Weave weave package for C/C++. I didn't use it myself, but I know it exists

Categories

Resources