Remove dead code, move Java path calculation