AOT compilation for languages like Java is full of interesting challenges.  I worked on gcj back in the day, and we had a super interesting Java&#x2F;C++ interoperability scheme called CNI:  <a href="https:&#x2F;&#x2F;gcc.gnu.org&#x2F;java&#x2F;papers&#x2F;cni&#x2F;t1.html" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;java&#x2F;papers&#x2F;cni&#x2F;t1.html</a>