Processing does not run code, Java related issues for Arch-Linux based operating system

// Declaring the sound Library
import ddf.minim.*;

// Declearing global class variables
Minim minim;
AudioPlayer audio;

void setup()
  minim = new Minim(this);
  audio = minim.loadFile("audio.mp3");
  size(800, 800);; 

void draw()
  ellipse(400, 400, audio.left.get(1)*800, 400);

This is my code and I am getting some errors.

(sorry couldn’t copy this to clipboard note this is not the full error message).

Do I need to setup Java or something?

Depends how you installed processing, if you used package from archlinux you will see there is dependency on java-8 runtime. I would recommend adoptopen-jdk, because the default jdk with archlinux (or debian for that matter) have linkage issues with Opengl sketches. If you installed direct from processing it includes a built in jre.

Oh sorry mate what do you mean by that? Do you mean install this particular package?

You can do a manual install from the seemingly the archlinux package is flagged out of date.

1 Like

I’d swear I was running the Processing package for Archlinux, but now the only package I see in the standard repository is this one (with only the examples):

In AUR I see several others:

The first one is the only one with a discussion around it, which may be useful.

One can also download processing directly from the website ignoring all these packages.

With this command you can see which Java is the default in your system and change it if needed:

archlinux-java status

I’m not sure if the default matters, or if Processing uses its own Java, even in Arch Linux?

1 Like

@hamoid in my experience the default java (as managed by archlinux-java) does not work with opengl sketches. I find I need to unset java to use the alternatives available at I have found both OpenJ9 or hotspot versions to work OK.

1 Like

Thank you, I don’t really remember how I set it up. This is what I see in the terminal:

$ archlinux-java status
Available Java environments:
  java-14-openjdk (default)
$ which processing
$ ls /usr/lib/jvm/
default@          java-10-openjdk/  java-14-openjdk/
default-runtime@  java-11-openjdk/  java-8-openjdk/

and P2D/P3D/shaders do work fine. Do you remember if there used to be a standard processing package for Arch last year? How to know which java it is using?

Ah so I’m not going crazy after all:

This package was moved from community to AUR after I reported a bug that is probably related to processing being compiled with OpenJDK instead of Oracle’s Java.

There are 3 pages of comments discussing the package.

I manually downloaded the latest one using the hotspot JVM. I extracted it, so what do I do now?

The command for me shows this:

  java-8-openjdk/jre (default)

What I normally do is to extract jdk in /opt then create symbolic links to /usr/bin/java etc. Are you sure Archlinux is the right distro for you? it sometimes requires a bit of manual intervention…

I extracted the folder to /opt. That is done. I know how to create symbolic links but inside /usr/bin java already exists, so am I supposed to overwrite it by replacing java with a symbolic that will point to /opt/jdk-14.0.2+12?

Well I am using an Arch-based distro which has an easy GUI installer (calamares). Plus using something that is Debian based is actually harder since apt is a much harder and more confusing package manager to use. At least pacman and yay are much more simple, I don’t need to worry about ppas and stuff.

I’ve run a lot of different linux systems and I have found debian systems to be very stable and quite easy to use, I do like Archlinux though and recently tried Manjaro on my RaspberryPI. However there are some well thought out features on debian such as update-alternatives, which is excellent for managing alternative versions of java (and anything else). Archlinux-java is new by by comparison and assumes you want to use an Arch installed jdk (also only works for java), if anything it makes installing an alternative jdk more difficult. My preferred debian is linux Mint, and I can see why people get put off by Ubuntu.

yes that is very true I have to admit that.

You should try EndeavourOS. I find that Manjaro Openbox edition takes up more RAM compared to EndeavourOS running KDE. Manjaro is kinda bloated in terms of memory usage.

Wish that could be part of Arch.

Yeah unfortunately, it kinda makes Arch a bad distro when it comes to programming.

Linux Mint is pretty nice I have to admit. But it takes up far too much memory.

One question mate, I know how to create symbolic links but inside /usr/bin, java already exists, so am I supposed to overwrite it by replacing java with a symbolic that will point to /opt/jdk-14.0.2+12? If so then inside the jdk-14.0.2+12 what should it specifically point to?

I use only ManjaroARM ie 64 bit OS on RaspberryPI (ARM64), Endeavour is x86_64 ie not usable. I’m hardcore ArchLinux otherwise (which is not for everybody), I wouldn’t get obsessed about using lightweight distro its generally the choice of desktop that makes any real difference. If you do archlinux-java unset, probably removes /usr/bin/java etc, deleting symbolic links is easy enough.

AH I see.

I did that.

Inside this directory jdk-14.0.2+12, there are many folders/files
bin/ conf/ include/ jmods/ legal/ lib/ man/ release

Which specific file am I supposed to create a symbolic link to?

Assuming you installed processing using this PKGBUILD for processing-3.5.4 then from the install script

ln -s /usr/lib/jvm/java-8-openjdk/ "$pkgdir/usr/share/processing/java"

you need to change /usr/lib/jvm/java-8-openjdk to wherever you unzipped the adopt-openjdk ie you only need to symbolically link the directory to /usr/share/processing/java. I hope that works for you because I’m not keen to offer further support.