Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JDK requirement for debug builds #988

Merged
merged 1 commit into from
Mar 28, 2025
Merged

Fix JDK requirement for debug builds #988

merged 1 commit into from
Mar 28, 2025

Conversation

Stefterv
Copy link
Collaborator

As noticed in #985, having to re-download the JDK for just a debug build is not necessary, this change makes the JDK download only required for distributable builds

@Stefterv Stefterv added this to the 4.4.2 milestone Mar 20, 2025
@babaissarkar
Copy link
Contributor

babaissarkar commented Mar 21, 2025

Just tested and this works as expected (i.e., launches without downloading the JDK), thanks!
Got this in terminal for no particular reason:

> Task :app:run
java.lang.reflect.InaccessibleObjectException: Unable to make field private static java.lang.String sun.awt.X11.XToolkit.awtAppClassName accessible: module java.desktop does not "opens sun.awt.X11" to unnamed module @2e39ef76
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
        at processing.app.platform.LinuxPlatform.initBase(LinuxPlatform.java:52)
        at processing.app.Platform.initBase(Platform.java:112)
        at processing.app.Base.<init>(Base.java:517)
        at processing.app.Base.createAndShowGUI(Base.java:286)
        at processing.app.Base.lambda$main$0(Base.java:130)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@Stefterv
Copy link
Collaborator Author

Great thanks for testing @babaissarkar

@babaissarkar
Copy link
Contributor

babaissarkar commented Mar 26, 2025

Getting this while trying to run a simple sketch:

Exception in thread "Thread-11" java.lang.RuntimeException: Exception while attempting /home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/bin/java -agentlib:jdwp=transport=dt_socket,address=8588,server=y,suspend=y,quiet=y -Djna.nosys=true -Djava.library.path=:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library:/home/ssarkar/bin/gcc/lib64:/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib -cp /tmp/processing/sketch_250326a10633024529789132423temp:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/annotations-13.0.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-main-2.5.0.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0-natives-linux-amd64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/kotlin-stdlib-2.0.20.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/core.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-main-2.5.0.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0-natives-linux-aarch64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0-natives-linux-aarch64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0-natives-android-aarch64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0-natives-windows-amd64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0-natives-windows-amd64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/antlr-2.7.7.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0-natives-linux-amd64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0-natives-linux-armv6hf.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0-natives-macosx-universal.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/jogl-all-2.5.0-natives-android-aarch64.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0-natives-linux-armv6hf.jar:/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/build/compose/tmp/prepareAppResources/core/library/gluegen-rt-2.5.0-natives-macosx-universal.jar -ea processing.core.PApplet --editor-location=0,0 --external --display=1 --sketch-path=/tmp/processing/697a9017-7a56-42e7-bf3c-d91c4b5f224f/sketch_250326a sketch_250326a
	at processing.core.PApplet.exec(PApplet.java:3197)
	at processing.mode.java.runner.Runner.lambda$launchJava$0(Runner.java:527)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.io.IOException: Cannot run program "/home/ssarkar2/hd2/Documents/Projects/Java/Eclipse/processing4/app/bin/java": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at java.base/java.lang.Runtime.exec(Runtime.java:594)
	at java.base/java.lang.Runtime.exec(Runtime.java:453)
	at processing.core.PApplet.exec(PApplet.java:3195)
	... 2 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 6 more

(tried to copy the full logs via the copy to clipboard button, but nothing got copied. Perhaps because I have a clipboard manager (Diodon)?)

Edit: Sketch runs after I symlink my system's java inside app/bin, as the error message suggests.

@Stefterv Stefterv merged commit 5c478a1 into main Mar 28, 2025
20 of 21 checks passed
@Stefterv Stefterv deleted the fix-jdk-requirement branch March 28, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants