I\'m using PyDev under Eclipse to write some Jython code. I\'ve got numerous instances where I need to do something like this:
import com.work.project.component
It is not a PYTHONPATH issue. It is related to importing/using static class-internal members of a Java class. I am getting the same sort of thing all over the place e.g. when trying to use constants in java.awt.Color:
import java.awt.Color as Color
borderColor = Color.BLACK # get "Undefined variable from import: BLACK" error
There is no way I've found to import Color.BLACK in this case. Thanks to iceman for at least pointing out the #@UndefinedVariable flag. That helps a lot. Note also that this is NOT a jython problem, the code runs just fine. It's just an issue with PyDev.