py5coding / py5generator

Meta-programming project that creates the py5 library code.
https://py5coding.org/
GNU General Public License v3.0
52 stars 13 forks source link

Mac M2 issue? #345

Closed tabreturn closed 1 year ago

tabreturn commented 1 year ago

I'm trying to run py5 on an M2 MacBook Pro. I've downloaded OpenJDK and set the export JAVA_HOME=... accordingly. When I run java --version, the system displays --

openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment Temurin-17.0.8+7 (build 17.0.8+7)
OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (build 17.0.8+7, mixed mode, sharing)

However, when I run Python and import py5, I get --

/Users/tristanbunn/Desktop/env/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
py5 is unable to start a Java 17 Virtual Machine.
This library requires Java 17 to be installed and a properly set JAVA_HOME environment variable.
Here is some debug info about your installation that might help you identify the source of this problem.
{'JAVA_HOME environment variable': '/Users/tristanbunn/Library/Thonny/jdk-17/Contents/Home', 'jvm version': (0, 0, 0), 'default jvm path': '/Users/tristanbunn/Library/Thonny/jdk-17/Contents/Home/lib/libjli.dylib'}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tristanbunn/Desktop/env/lib/python3.9/site-packages/py5/__init__.py", line 73, in <module>
    raise RuntimeError("py5 is unable to start Java 17 Virtual Machine")
RuntimeError: py5 is unable to start Java 17 Virtual Machine

Any ideas? Thanks in advance.

hx2A commented 1 year ago

Hi @tabreturn !

Can you try which java (or where, etc, whatever the command is on OSX) to see which java executable is on your path? Is it the same as what you have your JAVA_HOME environment variable set to?

How did you install Java 17? Did you use the install-jdk Python library? If not, can you try using that?

Can you look at the jpype docs and see if you can start the JVM via JPype?

tabreturn commented 1 year ago

Hmm. Thanks -- looks like something I can resolve by bumping the install-jdk library to the latest version.

hx2A commented 1 year ago

Excellent, glad you have py5 up and running now :)