由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Calling Java from C/C++
相关主题
Re: 问一个关于Java Native Interface的问题什么应用需要几百个节点的java呢
need help from the J2EE expertAndroid C/C++ native calls Java APIs
Java能帮我做这个project吗?Java会产生更多的page fault导致速度变慢
help!!你们谁去劝一下goodbug要点脸?
[转载] using C++ dll library from javaProject Panama builds a bridge between Java and C/C++
迷惑了很久,java 和 c++ 到底谁快?Eclipse JNI问题, 拜谢
How to build a java web service server?C++ JNI code to invoke native method – header an (转载)
java IPC with a C++ application[转载] suggestions?
相关话题的讨论汇总
话题: java话题: c++话题: calling话题: path话题: separator
进入Java版参与讨论
1 (共1页)
r**i
发帖数: 2328
1
I used to call C/C++ methods from Java side, now I want to use JNI to call
Java methods from C/C++. The code segment is like below:
#include
#include
#include
#ifdef _WIN32
#define PATH_SEPARATOR ';'
#else
#define PATH_SEPARATOR ':'
#endif
int main()
{
JavaVMOption options[1];
JavaVM *jvm;
JavaVMInitArgs vm_args;
long status;
JNIEnv *env;
jclass cls;
jmethodID mid;
jint square;
jboolean not;
options[0].optionString = "-Djava.class.path=.";
//memset(&vm_args, 0, size
r**i
发帖数: 2328
2
I solved this problem by loading jvm.dll at runtime and accessing
JNI_createJavaVM from a function pointer. However, I am still not sure about
this JVM's performance in multi-threads. Does anybody know?
THX!

in
my

【在 r**i 的大作中提到】
: I used to call C/C++ methods from Java side, now I want to use JNI to call
: Java methods from C/C++. The code segment is like below:
: #include
: #include
: #include
: #ifdef _WIN32
: #define PATH_SEPARATOR ';'
: #else
: #define PATH_SEPARATOR ':'
: #endif

1 (共1页)
进入Java版参与讨论
相关主题
[转载] suggestions?[转载] using C++ dll library from java
请教如何可以配置不同的项目源码迷惑了很久,java 和 c++ 到底谁快?
java可以直接去读txt file里指定的一行吗?How to build a java web service server?
Re: 如何读取serial port in Javajava IPC with a C++ application
Re: 问一个关于Java Native Interface的问题什么应用需要几百个节点的java呢
need help from the J2EE expertAndroid C/C++ native calls Java APIs
Java能帮我做这个project吗?Java会产生更多的page fault导致速度变慢
help!!你们谁去劝一下goodbug要点脸?
相关话题的讨论汇总
话题: java话题: c++话题: calling话题: path话题: separator