jython __init__.py and jar files

T

Todd Moyer

I was trying to run an example from the Jython Essentials book but kept getting
an error saying:

java package 'org.jdom.input' has no attribute 'SAXBuilder'

Apparently, it couldn't find the SAXBuilder class, even though I
had set the sys.path to the jar and it seemed to be finding the jar.

Eventually I extracted the files from the jar, but it still wasn't finding
the SAXBuilder class. Then I added __init__.py files to the 'org', 'jdom' and
'input' dirs and wallah!, everything works.

This leads me to a rather odd conclusion:

A real Java jar isn't going to work for Jython because it won't have __init__
files.

Has anyone else run into this? Is my conclusion correct or am I missing
something?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,055
Members
47,659
Latest member
salragu

Latest Threads

Top