GeezerVison is showing github.com — The `System.getProperty("java.home")` points to the JRE bundled with Processing and not the JDK · Issue #1163 · processing/processing4
The System.getProperty("java.home") points to the JRE bundled with Processing and not the JDK #1163DescriptionMost appropriate sub-area of Processing 4?
Core/Environment/Rendering
Processing version
4.4.0 through 4.4.4
Operating system
Linux Fedora/KDE, Windows 11, and MacOS X Sonoma (intel)
Bug description
I’m getting these errors with code that worked in version 4.3.4,
The package “java.sql” does not exist. You might be missing a library.
The package “com.sun.net” does not exist. You might be missing a library.
Steps to reproduce this
"1.Run a sketch that imports these packages.
"
snippet
// Paste your code below :)
import java.sql.*;
import com.sun.net.httpserver.*;
void setup() {
}
void draw() {
}
Additional context
I've tested version 4.4.4 and previous versions back to 4.4.0 on Linux/MacOS/Windows and all exhibit this bug.
I am selecting that I'd like to help but I have no experience in Gradle, etc.
Would you like to work on the issue?
Yes, I’d like to help with this Reacted by Raphaël de Courville ActivitySableRaf commented on Jul 2, 2025 Thanks @pervisjohannsen for reporting this and testing on different versions.
Processing 4.4 switched from bundling a full JDK to generating a custom JRE with jlink as part of the new Gradle build (see #888, #968, and the 4.4 release notes). To reduce the download size, only a minimal set of modules was included.
I tested a fix locally by adding java.sql to the modules list in nativeDistributions inside of app/build.gradle.kts (same place where java.scripting was added in PR #1056). After rebuilding, the sketch compiles and runs fine again (see screenshot below). I also tried adding jdk.httpserver but the sketch still shows No library found for com.sun.net.httpserver 🤔 That's as far as I was able to get with my limited knowledge of Gradle.
We could include these in the build, but this raises a broader question about which modules we should include by default. We're currently migrating the internal sketch runner to Gradle, and I'm guessing that could eventually support automatically resolving or downloading missing modules (@Stefterv let me know if I’m on the right track here).
 Stefterv commented on Jul 2, 2025 Hmm, I am surprised that did anything to be honest. We include the entire JDK for building sketches so there should not be any missing modules. At #1056 there was a missing module for code that ran within the PDE, so that is a different case than here. I suspect somehow the compilation stage is using the wrong JDK? Reacted by Raphaël de Courville SableRaf commented on Jul 2, 2025 Ok I edited my comment to cross out my wrong assumptions :D pervisjohannsen commented on Jul 2, 2025 This may be irrelevant now, but I think jdk.httpserver is just a wrapper for com.sun.net.httpserver. Stefterv commented on Jul 2, 2025 Just ran the debugger and the Eclipse Compiler is hardcoded to use the System.getProperty("java.home") so we can temporarily override the system property before running the old compiler, or another solution if anyone has better ideas. Stefterv commented on Jul 2, 2025
This solves the issue with java.sql not being available, not sure if setting System.getProperty("java.home") is going wreck havoc somewhere else so not a fan of this solution. Reacted by Raphaël de Courville Stefterv commented on Aug 11, 2025 changed the title [-]Missing package/libraries in new builds[/-] [+]The `System.getProperty("java.home")` points to the JRE bundled with Processing and not the JDK[/+] on Aug 11, 2025Stefterv commented on Aug 11, 2025
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|