Im developing a plugin in eclipse which reads from a C++ file. I have const char * data in my C++ file and I have the following program to read into Java, but error occurs while reading the string part, while it works fine for long and integer. Can anybody point out what the mistake is?
1. You say, "but error occurs." Keep in mind that ItDoesntWorkIsUseless(←click). You need to TellTheDetails(←click) about exactly went wrong. Copy/paste the exact, complete error message, and indicate clearly which line caused it.
2. If the error occurs during execution of that code, then it probably has nothing to do with Java. Let us know if that's the case, and one of the mods can move this thread to this site's C/C++ forum. Otherwise, if the error occurs in the Java that tries to use this code, then you'll need to provide more details about your overall JNI or JNA setup.
posted 6 years ago
@Jeff Thanks for the reply! The C++ part works fine and compiles without any errors. When I try to read the string data in Java using Eclipse, I get a fatal error for exception access violation. So this is a problem with Java.
Preet Rams wrote:@Jeff Thanks for the reply! The C++ part works fine and compiles without any errors.
Just to be clear: It compiles AND you tested its functionality, outside of Java? Or by "works and compiles", do you just mean that it compiles? That's a crucial distinction.
When I try to read the string data in Java using Eclipse, I get a fatal error for exception access violation. So this is a problem with Java.
Again: Copy/paste the exact, complete error message.
It's 2:30 a.m. where I am, so I'm off to get reacquainted with my pillow soon, and I don't really know much about JNI anyway, but with any luck, with those last to bits of information, somebody else will be able to come in and give you some guidance toward fixing the problem.
posted 6 years ago
By compiles, I mean it just compiles. And I have not tested it outside Java environment.
The exact error message that I get is:
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006da5a770, pid=1504, tid=2876
JRE version: 6.0_41-b02
Java VM: Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode windows-amd64 compressed oops)
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
how do I do my own kindle-like thing - without amazon