summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-11-22 10:10:23 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2018-11-22 10:10:23 +0200
commit832cf437dffdac83353b434433274fec21461f8d (patch)
tree05980499f232bf6c9a72d1bcede0971963d90afc /src
parentfc089685f7e3575931713224aff310f0f4a20be4 (diff)
libjvm-java: Implement more system properties
Diffstat (limited to 'src')
-rw-r--r--src/libjvm-java.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libjvm-java.c b/src/libjvm-java.c
index fb1d81b..cf13544 100644
--- a/src/libjvm-java.c
+++ b/src/libjvm-java.c
@@ -14,9 +14,11 @@ jstring
java_lang_System_getProperty(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
- char value[92]; // PROP_VALUE_MAX 92
const char *key = (*env)->GetStringUTFChars(env, va_arg(args, jstring), NULL);
+ if (!strcmp(key, "java.vm.version"))
+ return (*env)->NewStringUTF(env, "1.6");
+
union {
void *ptr;
int (*fun)(const char*, char*);
@@ -25,6 +27,7 @@ java_lang_System_getProperty(JNIEnv *env, jobject object, va_list args)
if (!(__system_property_get.ptr = dlsym(RTLD_DEFAULT, "__system_property_get")))
return NULL;
+ char value[92]; // PROP_VALUE_MAX 92
__system_property_get.fun(key, value);
return (*env)->NewStringUTF(env, value);
}