Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

gat98

Greenhorn
+ Follow
since Jul 06, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by gat98

Hi
I had downloaded jaxp1.1 and installed the jar files in the classpath but when i compile my .java file importing the xml packages i get Class org.w3c.dom not found in import,Class org.xml.sax not found in import.Kindly tell me what is the problem and please do help me solve this problem.I am really getting frustrated.
thanks
gaya

Originally posted by amit shukla:
Hi all,
I guess we dont have any forum particularly for JNI... thats y posting the porblem here...
whats the difference between passing a jstring from a java program to 'c' method AND using scanf from within the 'c' code to read the string from java execution environment... somewhat like done in the following 'c' method.....
here jstring 'str' is passed from a java method AND another string is read from the command prompt using scanf("%s", buf)
why in the first case we require conversion from unicode to UTF8 and not in the second case ....

JNIEXPORT jstring JNICALL Java_HelloName_displayHelloName(JNIEnv *env, jobject obj, jstring str)
{
char buf[128];
const char *s = (*env)->GetStringUTFChars(env, str, 0);
printf("Hello , %s\n",s);
(*env)->ReleaseStringUTFChars(env, str, s);
scanf("%s", buf);
return (*env)->NewStringUTF(env, buf);

}


Hey
If you know the answer please let me know
thanks
gat
19 years ago

Originally posted by Chris Huisman:
I am having trouble starting a JVM via JNI. Does anybody know what the return value of JNI_CreatJavaVM indicates?


JNI_CreateJavaVM fills in two return values:
jvm refers to the created Java Virtual Machine. You can use this to destroy the Virtual Machine at a later time.
env is a JNI interface pointer that the current thread can use to access Java features, such as calling a Java method.
regds
gat
19 years ago