Java to sgfm