C ++ exceptions can only be handled in C ++ code. They will never be able to escape the C ++ world (i.e., the C ++ C code interface should never allow the distribution of exceptions). It is possible that a C ++ exception is propagated through a C code layer between two C ++ modules (for example, when a C ++ function calls a C function, which in turn calls a C ++ function).
One of the reasons for this is that there is no standard on how C ++ exception should be implemented, so C ++ modules are only binary compatible if they are compiled by the same compiler (in the same version). Therefore, code in any other language cannot be configured to handle C ++ exceptions.
In this case (the C ++ library, the C interface, is called from Java) you have to catch the C ++ exception, distribute the information through the C interface (for example, using error return codes), check it in Java and throw an exception there.
source share