Finding "PATH" In Flatpak

I found a topic for JRE not showing up for a flatpak install of the routing tool of KiCAD 8. It says I need to add that location to the PATH environment variable (I’m on Linux/Ubuntu). Now I know where the KiCAD install is for flatpak, and I know where the JRE is in flatpak. However, I don’t think the flatpak uses the same “~/.bashrc” path that everything else uses (I’m speaking of outside of flatpak where the rest of my Ubuntu login looks for config). Where do I find the PATH variable to update for a flatpak install? I can update it if I know which file or location I need to edit.

Flatpak does not have access to system binaries by design. You can probably write a shell script which will call flatpak-spawn --host /usr/bin/java , name that script java, put it somewhere flatpak has access and add it to path by passing --env=PATH=/app/bin:/custom/bin. I haven’t tested this and you will have to figure out exact steps yourself.

Your best bet to avoid all this headache is to get rid of flatpak and install kicad natively through official ppa.

The JRE is inside of flatpak, so it isn’t part of the system. The reason I must use this is because my current Linux cannot be upgraded (for other reasons) and I need the newer KiCAD; plus, if I install a newer one without flatpak, then FreeCAD breaks. I can get both newer KiCAD and newer FreeCAD this way.

I can try passing as an argument, but the path is within flatpak; would I just use the “--env=PATH=/custom/bin:$PATH”? Or something similar? I don’t like using flatpak, but it solves a dilemma of two unacceptable failures.

Yeah if you can’t upgrade your OS then flatpak is probably your only choice.
Where is the jre in the flatpak?
Shell expansion will not work so you have to find out what is current PATH and append it in full. It’s probably just /app/bin:/usr/bin.

There’s my problem: Where do I look at $PATH directly from KiCAD when it runs in flatpak? Maybe it is a flatpak problem, but I’d hoped someone else had used KiCAD with flatpak before and knew where $PATH is set. It certainly isn’t in my ~./bashrc.

You can get a shell from inside flatpak using flatpak run --command=bash <flatpakid> and then just echo $PATH from there.