An alternative, if you want to do as follows:- Compile Java program to an executable (not jar file)- Call this executable and get the return values from itSo you can think about Unix module in OCaml, you can use the standard I/O to realize a communication channel between your OCaml code and the executable Java.