小编sb2*_*b27的帖子

JNI Throw是否会中断方法执行?

当我调用时env->ThrowNew(clazz, "..."),会不会停止随后执行C ++ / C方法,还是我必须自己停止它?

// This is the method which checks if a class can be loaded.

static inline jclass _check_find_class(JNIEnv* env, char* name) {
    jclass clazz = env->FindClass(name);

    if (clazz == NULL) {
        env->ThrowNew(env->FindClass("java/lang/NoClassDefFoundError"), message);
    }

    return clazz;
}

// This method is called in other functions like

jclass load_main_class(JNIEnv* env) {
    auto clazz = _check_find_class(env, "class/which/cannot/be/loaded");

    do_stuff(env, clazz);

    return clazz;
}
Run Code Online (Sandbox Code Playgroud)

当我调用load_main_class方法,找不到类并ThrowNew调用该方法时会发生什么?

c++ java java-native-interface

4
推荐指数
1
解决办法
49
查看次数

Java Process.waitFor() 与 Process.exitValue()

java.lang.Process.waitFor() 和 exitValue() 之间有区别吗?

java shell process

2
推荐指数
1
解决办法
1881
查看次数

如何从源代码编译JDK?

有没有办法从源代码编译 JDK?还有源码的官方下载吗?我想为我的智能手机编译它。

java compilation

-1
推荐指数
1
解决办法
1371
查看次数

标签 统计

java ×3

c++ ×1

compilation ×1

java-native-interface ×1

process ×1

shell ×1