-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__javaclass__ definition missing #193
Comments
Got the same error on Ubuntu 14.04 Here is my simple python code from jnius import autoclass
import jnius_config
jnius_config.set_classpath('.', '/usr/local/fem/plugins/*')
import jnius
Test = autoclass('Test.Test')
Test.hello() and got this error:
|
Hello Guys. I'm in the same situation with Lubuntu in virtual box from kivy installation. |
Which version of six.py are you using? Mine is working fine with six.py=1.10.0 with python 3.5.1. I know it's not a professional solution but for me worked upgrading the package in the virtual env with the following command: |
I've tried or is it my installation of java ? |
Please upgrade the |
My version of six is already up to date. Now I've done
But got the same mistake. |
The source shown in your traceback is from a pre-1.7.0 version. def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass. Because of internal type checks
# we also need to make sure that we downgrade the custom metaclass
# for one level to something closer to type (that's why __call__ and
# __init__ comes back from type etc.).
class metaclass(meta):
__call__ = type.__call__
__init__ = type.__init__
def __new__(cls, name, this_bases, d):
if this_bases is None:
return type.__new__(cls, name, (), d)
return meta(name, bases, d)
return metaclass('temporary_class', None, {}) I confirmed that everything worked in 1.7.0 and later versions, and didn't work in pre-1.7.0 versions. Your issue is most likely that you have two different versions of six installed. The one from Lubuntu (package |
If I get you right, I should try
Or please can you juste paste me the commands I should type ? |
Use |
My current installation of six is 1.10.0. |
so... what should I do next ? |
Well if you still have this issue then you are still using a version of six < 1.7.0. Make sure you aren't using a virtualenv including an old version, or that you have something in your PYTHONPATH pointing to another location. |
I'm not using virtualenv at all. But I found in my sys.path
I get an KeyError: 'JAVA_HOME' My Java folder is '/usr/lib/jvm/java-1.7.0-openjdk-amd64'
and it Worked !!! |
Make sure to set your |
Hello!
I've build pyjnius from sources on Ubuntu 14.04 and get the following error after installation:
root@staging:/tmp/pyjnius# make tests (cd tests; env CLASSPATH=../build/test-classes:../build/classes PYTHONPATH=..: nosetests -v) Failure: JavaException (__javaclass__ definition missing) ... ERROR Failure: JavaException (__javaclass__ definition missing) ... ERROR
...and all 16 tests fail.
I did to to have jnius_config module that is missing in pip package.
Detailed error:
`======================================================================
ERROR: Failure: JavaException (javaclass definition missing)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/tmp/pyjnius/tests/test_bad_declaration.py", line 5, in
from jnius import JavaException, JavaClass
File "build/bdist.linux-x86_64/egg/jnius/init.py", line 13, in
File "build/bdist.linux-x86_64/egg/jnius/reflect.py", line 14, in
File "/usr/lib/python2.7/dist-packages/six.py", line 617, in with_metaclass
return meta("NewBase", bases, {})
File "jnius/jnius_export_class.pxi", line 43, in jnius.MetaJavaClass.new (jnius/jnius.c:17159)
meta.resolve_class(classDict)
File "jnius/jnius_export_class.pxi", line 56, in jnius.MetaJavaClass.resolve_class (jnius/jnius.c:17474)
raise JavaException('javaclass definition missing')
JavaException: javaclass definition missing`
The text was updated successfully, but these errors were encountered: