Hi Jesper,

(Please subscribe to pylucene-dev so that I don't have to moderate you in
every time).

You do need --shared to load multiple JCC built libraries into the same Java
VM, regardless of whether you're using python or not.

Looking at the sources, I see at line 544 in JCCEnv.cpp, in the
reportException() method that to report a _python_ exception from a Java
error, a PythonException _java_ class is necessary. That class is only
available when using --shared mode.

You are not using python, thus the --shared question is moot as applied to
the exception issue. To answer your original question, I do not know why
exception reporting is behaving like you're seeing - only a debugging
session with JCC built with DEBUG mode enabled and a real debugger is going
to help tell. I do not have access to Windows at all so I can't help with
debugging this myself.

See my response above. Using --shared changes how things are linked and
initialized at runtime, not the generated code itself.