Be happy that it works and move on. Transfering complex objects between different runtimes isnt possible because of memory layout.
You may transfer some byte array in which the data is an reinterpret it. Like
struct Data {
int i;
int lenstr;
int lenstrr;
char* data; };
In Java you can fizzle the bytes out.