weird issues with java and c++