# Cannot run processing-java from bashfile; but works directly from terminal

**URL:** https://discourse.processing.org/t/cannot-run-processing-java-from-bashfile-but-works-directly-from-terminal/40898
**Category:** Processing for Pi
**Created:** [February 11, 2023, 11:32am UTC](https://discourse.processing.org/t/cannot-run-processing-java-from-bashfile-but-works-directly-from-terminal/40898 "2023-02-11T11:32:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fabianluscher](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fabianluscher/32/17959_2.png) [@fabianluscher](https://discourse.processing.org/u/fabianluscher)
#### Post date: [February 11, 2023, 11:32am UTC](https://discourse.processing.org/t/cannot-run-processing-java-from-bashfile-but-works-directly-from-terminal/40898/1 "2023-02-11T11:32:45Z")

</div>

Hi all!  
I want to run a **processing sketch on startup** of my raspberry pi.  
therefore I added this line to `/home/esc/.config/lxsession/LXDE-pi/autorun`:

```auto
sudo /home/esc/Applications/processing-4.1.2/processing-java --sketch=/home/esc/Applications/sketchbook/elisas_synchronotron --run

```

this does not work - same when running the same line from a bashfile `startSketch.sh`:

```auto
#!/usr/bin/env bash
sudo /home/esc/Applications/processing-4.1.2/processing-java --sketch=/home/esc/Applications/sketchbook/elisas_synchronotron --run

```

**The error** in both cases is:

```auto
esc@raspberrypi:~ $ sudo /home/esc/Desktop/startSketch.sh 
No library found for controlP5
No library found for processing.io
No library found for hypermedia.net
Libraries must be installed in a folder named 'libraries' inside the sketchbook folder (see the Preferences window).
mySketch.pde:0:0:0:0: The package “controlP5” does not exist. You might be missing a library.

```

If I type the same command **directly into my terminal, the sketch starts as expected** , the libraries are found:

```auto
esc@raspberrypi:~ $ sudo /home/esc/Applications/processing-4.1.2/processing-java --sketch=/home/esc/Applications/sketchbook/mySketch --run
......(var output from my sketch)

```

it works just A-ok! **Why?**  
Also, if I start the GUI and press play it works as well.

My **sketchfolder is set** to `/home/esc/Applications/sketchbook` in the settings and my libraries are all in `/home/esc/Applications/sketchbook/libraries` installed with the GUI tool “manage libraries…”.

**what am I missing?**  
I’m relatively new to linux&raspbian so i might just be something with folder read/write permissions, or with the `sudo`?

thanks!

some infos about my setup:  
processing 4.1.2  
Raspbian GNU/Linux 11 (bullseye)  
Raspberry Pi 3 Model B Rev 1.2

---

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [March 20, 2023, 9:22pm UTC](https://discourse.processing.org/t/cannot-run-processing-java-from-bashfile-but-works-directly-from-terminal/40898/2 "2023-03-20T21:22:20Z")

</div>

Hi @fabianluscher, Welcome (late, sorry) to the forum. I can’t verify or not all that you say, but I have just done this. Followed the instructions [here](https://forums.raspberrypi.com/viewtopic.php?t=314455) and downloaded the boot.zip.

For me the file path is /home/rdl/.config/lxsession/LXDE-pi/autostart

The contents of that file is 3 lines that came from the default, and one that I added:

sketchbook/Show\_IP\_Address/linux-arm/Show\_IP\_Address

In the Processing IDE I had already exported the sketch, and in the directory it builds is that file. Not quite sure what it is, it’s not the whole application, just some kind of shortcut. (It works, what I want, at a code club, is something on the screen that shows me the IP address of the Pi.)

Hope this helps.

---

<div class="post-metadata">

### Author: ![fabianluscher](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fabianluscher/32/17959_2.png) [@fabianluscher](https://discourse.processing.org/u/fabianluscher)
#### Post date: [March 21, 2023, 9:56am UTC](https://discourse.processing.org/t/cannot-run-processing-java-from-bashfile-but-works-directly-from-terminal/40898/3 "2023-03-21T09:56:20Z")

</div>

hi richardDL, thanks for the welcome.  
Yes, my problem might be solved if i would export the application correctly as you have, and not start the processing gui with the sketch as argument. But i’ve had multiple problems with exporting my sketch as application from and to raspberry pi, so i’ve hoped to circumvent this by just starting the processing gui with the sketch parameter. I’m not aware of any downsides to this, apart from maybe small performance issues?

I “solved” this with the solution to my other question - owner/group owner of the tmp folder gets changed each time:

> [@On Startup: "That's new to me - A strange and unexplainable error occurred"](https://discourse.processing.org/t/on-startup-thats-new-to-me-a-strange-and-unexplainable-error-occurred/40899/3):
>
> Solved: Somehow, the owner / group ownership got (?) changed for the folder /tmp/processing where tmp files are created for running a sketch. The owner/group was “root / root” and i’m not sure what the initial value was. If I change those to my current user with $ sudo chgrp GROUPNAME /tmp/proccessing $ sudo chown OWNERNAME /tmp/proccessing It works again. Not sure how long though. and what I did that those ownerships got changed or what else might be amiss. EDIT: calling “sudo …/process…

But i guess next test would be to export the application and see if the problem persists.

thanks!
