convert log2 to invoke java