# Java library problems

**URL:** <https://discourse.processing.org/t/java-library-problems/45377>\
**Category:** py5\
**Created:** [November 23, 2024, 1:11pm UTC](https://discourse.processing.org/t/java-library-problems/45377 "2024-11-23T13:11:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [November 23, 2024, 5:56pm UTC](https://discourse.processing.org/t/java-library-problems/45377/2 "2024-11-23T17:56:28Z")

</div>

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. 🤞

* * *

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`

---

_[View the full topic](https://discourse.processing.org/t/java-library-problems/45377)._
