Cross-platform code for Java