Java library problems

Besides these 3 standard command-line troubleshoot checks:

  1. echo %JAVA_HOME%
  2. where java
  3. java -version

We can run the “System Properties” in order to edit the “Environment Variables”:
%SystemRoot%\System32\SystemPropertiesAdvanced.exe

The “Environment Variables” is split in 2 parts: “User” & “Sys” vars.

Make sure var JAVA_HOME is set on both parts and has this string value:
%ProgramFiles%\Java\jdk-23\bin
%ProgramFiles%\Java\jdk-23

In my laptop it’s %ProgramFiles%\Java\jdk-21 b/c that’s my current Java version.

After setting the var JAVA_HOME in both places, access the var Path on the “User” section.

If it doesn’t exist yet, add %JAVA_HOME%\bin as 1 of its entries, and move it up, making sure it’s 1 of the top entries.

You can also add a %CommonProgramFiles%\Oracle\Java\javapath entry to the Path, which is a folder containing the default Java version’s basic executables.

Now do the same for the “Sys” section and you’re done.

If you prefer, you can restart Windows to make sure those changes will take effect.

Now I believe import py5 should be able to find your JDK Java; let’s hope so. :crossed_fingers:


EDIT: Chat AI stated we shouldn’t use “\bin” for the JAVA_HOME variable!

So you should just use %ProgramFiles%\Java\jdk-23 as the JAVA_HOME value.

Then add it as a var “Path” entry like this: %JAVA_HOME%\bin

1 Like