gen-midia to java