2

I have Java 1.6.0_17 installed in /usr/local/bin. My Java program is compiled with 1.7.0_11.

pyjnius fails in a call X = autoclass('HelloWorld')

When HelloWorld.java is compiled with 1.6, everything works.

I cannot get pyjnius working with 1.7.

I've tried setting JAVA_HOME before importing jnius:

import os
os.environ['JAVA_HOME'] = '/usr/local/pkgs/jdk-1.7.0.11'
from jnius import autoclass
XX = autoclass('HelloWorld')

I've also set JAVA_HOME in .bash_profile and added /usr/local/pkgs/jdk-1.7.0.11/bin the first in my PATH.

jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
tixi
  • 23
  • 3
  • Try rerunning 'sudo python setup.py install' to configure pyjnius with the new java environment. –  Jul 07 '15 at 23:30
  • This is it. Thanks! Please let me know how to mark your answer as a correct one. – tixi Jul 08 '15 at 12:37
  • Glad it worked. I posted my reply as an answer so you can mark it. –  Jul 08 '15 at 21:05

1 Answers1

0

pyjnius needs to be reinstalled in order to configure it with the new java environment. That can be done by running the following in the downloaded or cloned pyjnius GiHub project folder:

sudo python setup.py install