0

I am following this answer: Distributing my Python scripts as JAR files with Jython?

This is the python file (myFILE.py) I am trying to convert to a jar file:

from tkinter import *
root = Tk()
root.mainloop()
  • 1) Download jython

(inside jython folder)

  • 2) cp jython.jar jythonlib.jar
  • 3) zip -r jythonlib.jar lib
  • 4) cp jytonlib.jar myapp.jar

Finally, I try to run it:

  • 5) java -jar myapp.jar myFile.py

ImportError: no module named tkinter

How can I add the tkinter library to the jython/lib folder?

Bjango
  • 333
  • 5
  • 15

1 Answers1

0

You have to add the tkinter library into your project as well or you have to route the import way to the path where it is. In Python you have your PYTHONPATH stuff where (I guess nearly) every library is on his place. But you haven't got that possibility in Jython. This needs everything.

zonk
  • 147
  • 14