add java code in main.py