natural / java2python

Simple but effective library to translate Java source code to Python.
GNU Lesser General Public License v2.1
564 stars 243 forks source link

Install and run j2py on Ubuntu 18.04 #72

Closed raul-parada closed 3 years ago

raul-parada commented 3 years ago

I've tried to run java2python on Ubuntu 18.04, however, I cannot make it run correctly. These were my steps:

  1. Install antlr 3.13 (following Old School at https://github.com/natural/java2python/blob/master/doc/install.md)
  2. Install java2python (following Old School at https://github.com/natural/java2python/blob/master/doc/install.md)
  3. My version of Python is 2.7.17 (Initially it had 3.6 however, after step 2, it switch to 2.7
  4. Enter in folder java2python-0.5.1/build/scripts-2.7 from terminal and execute "j2py". The result is

image

  1. Then, I've tried "j2py file.py" (file.py doesn't exist, I though the function creates it by default). The result is

image

I didn't set up any PATH I guess it is not necessary on Linux Inside the folder scripts-2.7, I insert a .java and a .jar file

What I'm missing?

raul-parada commented 3 years ago

I've solved it using

j2py -k "filename".java OUTPUT