Skip to content

Snap does not have the commandline processing-java available #1047

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

Closed
berkes opened this issue Apr 18, 2025 · 4 comments · Fixed by #1050
Closed

Snap does not have the commandline processing-java available #1047

berkes opened this issue Apr 18, 2025 · 4 comments · Fixed by #1050
Assignees
Labels
bug Something isn't working
Milestone

Comments

@berkes
Copy link

berkes commented Apr 18, 2025

Most appropriate sub-area of Processing 4?

Other (specify if possible)

Processing version

4.4.1

Operating system

Linux Ubuntu 24.04.2 LTS x86_64

Steps to reproduce this

  1. Install from source. See a binary called /path/to/source/processing-java. Run this binary with --help. It will show help, starting with
Command line edition for Processing 1295 (Java Mode)

(version will differ)

  1. Now remove it and instead use the new snap to install. Run snap info processing
name:      processing
summary:   A friendly software sketchbook
....
commands:
  - processing

Notice there is no processing-java.

running snap run processing --help launches the GUI an shows an error on the terminal, that --help is not recognized.

Expected behaviour:

snap run processing-java

To run the CLI mode. E.g.

snap run processing-java --sketch /path/to/SomeSketch --run

To compile and run a sketch.

Offering the CLI in a separate snap would be fine as well.

snippet

Not applicable

Additional context

No response

Would you like to work on the issue?

No - I am unfamiliar with the build process of Processing, Gradle, Java

@berkes berkes added the bug Something isn't working label Apr 18, 2025
@Stefterv Stefterv self-assigned this Apr 18, 2025
@Stefterv
Copy link
Collaborator

Hey @berkes Thank you for raising this issue!

As we migrated to the Gradle build system in #888 we didn't catch the use of processing-java in the betas. I just took a look and our snap configuration does not allow us to replicate the processing-java command directly (only processing.processing-java).

So we have two options, either we publish a secondary package on snap called processing-java which would require you to install processing-java separately. Or we roll this functionality directly into the PDE (which I am more in favour of) so we could replace $ processing-java with $ processing -cli for example

@Stefterv Stefterv added this to the 4.4.3 milestone Apr 18, 2025
@Stefterv Stefterv changed the title Snap does not have the commandline "processing-java" available Snap does not have the commandline processing-java available Apr 18, 2025
@SableRaf SableRaf moved this to Backlog in Processing Roadmap Apr 18, 2025
@SableRaf SableRaf moved this from Backlog to In progress in Processing Roadmap Apr 19, 2025
@berkes
Copy link
Author

berkes commented Apr 22, 2025

If it helps: As a snap user, I won't really mind installing a second snap, but since that means a rather big lot of duplication of overhead. i.e. some 430M of storage extra, I'd slightly prefer it to be in the one snap package.

@github-project-automation github-project-automation bot moved this from In progress to Done in Processing Roadmap Apr 25, 2025
@Stefterv
Copy link
Collaborator

Hey @berkes 4.4.3 adds processing cli as a replacement for processing-java on Linux

@berkes
Copy link
Author

berkes commented May 5, 2025

I've finally had the time to test it. Thanks.

It doesn't work yet, unfortunately. And I'm unsure if I should report this in this ticket (re-open it?) or in a new. In any case, the bug seems simple to fix: a file-permission issue.

snap run processing cli --sketch=complex_waterlily --run

Exception in thread "Thread-0" java.lang.RuntimeException: Exception while attempting /snap/processing/8/opt/processing/lib/app/resources/jdk/bin/java -agentlib:jdwp=transport=dt_socket,address=8033,server=y,suspend=y,quiet=y -Djna.nosys=true -Djava.library.path=:/snap/processing/8/opt/processing/lib/app/resources/core/library:/snap/processing/8/opt/processing/lib/runtime/lib:/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void:/snap/processing/8/usr/lib:/snap/processing/8/usr/lib/x86_64-linux-gnu:/snap/processing/8/opt/processing/lib/app:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib -cp /tmp/processing/complex_waterlily7789541850726054473temp:/snap/processing/8/opt/processing/lib/app/resources/core/library/annotations-13.0.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/antlr-2.7.7.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/core-4.4.3.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0-natives-android-aarch64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0-natives-linux-aarch64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0-natives-linux-amd64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0-natives-linux-armv6hf.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0-natives-macosx-universal.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0-natives-windows-amd64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-2.5.0.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/gluegen-rt-main-2.5.0.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0-natives-android-aarch64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0-natives-linux-aarch64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0-natives-linux-amd64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0-natives-linux-armv6hf.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0-natives-macosx-universal.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0-natives-windows-amd64.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-2.5.0.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/jogl-all-main-2.5.0.jar:/snap/processing/8/opt/processing/lib/app/resources/core/library/kotlin-stdlib-2.0.20.jar -ea processing.core.PApplet --display=-1 --sketch-path=/home/ber/Documents/ART_art/art/processing/complex_waterlily complex_waterlily
	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(Unknown Source)
Caused by: java.io.IOException: Cannot run program "/snap/processing/8/opt/processing/lib/app/resources/jdk/bin/java": error=13, Permission denied
	at java.base/java.lang.ProcessBuilder.start(Unknown Source)
	at java.base/java.lang.ProcessBuilder.start(Unknown Source)
	at java.base/java.lang.Runtime.exec(Unknown Source)
	at java.base/java.lang.Runtime.exec(Unknown Source)
	at processing.core.PApplet.exec(PApplet.java:3195)
	... 2 more
Caused by: java.io.IOException: error=13, Permission denied
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(Unknown Source)
	at java.base/java.lang.ProcessImpl.start(Unknown Source)
	... 7 more

Looking at the file, reveals it does not have the executable bit set:

ls -ahl /snap/processing/8/opt/processing/lib/app/resources/jdk/bin/java 
Permissions Size User Date Modified Name
.rw-r--r--   16k root 25 apr 15:10  /snap/processing/8/opt/processing/lib/app/resources/jdk/bin/jav

The normal snap run processing runs the GUI just fine, and snap run processing lsp fails, but with a different error - not the java exec permission error.

I presume simply setting the exec bit on /snap/processing/8/opt/processing/lib/app/resources/jdk/bin/java would fix the bug, but haven't tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

2 participants