I am trying to create a shared library(dll with header and lib files) of a java code using graalvm.
there will be one java method with 2 parameters of type String which I will call from c++.
I am using a maven project, I am not able to create the dll out of my java code, I am using graalvm to convert my java code to dll.
My java code looks like this:
package demo;
import org.graalvm.nativeimage.IsolateThread;
import org.graalvm.nativeimage.c.function.CEntryPoint;
public class MyClass{
@CEntryPoint (name = "myFunc")
public static byte[] myfunc(IsolateThread thread, String x, String y) {
// logic goes here
byte[] arr = "byte array will contain actual bytes".getBytes();
return arr;
}
but when I try to build the code into dll, I got this error
Error: Entry point method parameter types are restricted to primitive types, word types and enumerations (@CEnum): demo.MyClass.myFunc(IsolateThread, String, String)
I searched but didn't find suitable solutions to this problem. can anyone here please tell me how to call java methods from c++ with non-primitive datatypes any suggestions of any kind will be a great help, thanks in advance