fully working java->js generator