Page 1 of 1

SBC4 Java works everywhere but internal

Posted: Tue Sep 04, 2018 2:38 pm
by Gexleo
So I am struggling to figure this one out. I have a bit of code to watch voltage inputs and blast out an UDP message on network once it hits a threshold. Code works amazing. It even works amazing when I launch it through the SBC4's web gui.. But when I attempt to run the code locally through it's command line, it gives the following error:

Code: Select all

Error: Could not find or load main class buttonScanner.jar
Mind you, this same program works if i navigate to Projects >> Project page >> and clicking start.

I tried to pick apart the web page to see what command it is launching but no luck. Any assistance?

Local commands attempted:

Code: Select all

java buttonScanner.jar

Code: Select all

java /usr/userapp/*programfolder*/buttonScanner.jar

Re: SBC4 Java works everywhere but internal

Posted: Wed Sep 05, 2018 12:48 pm
by Patrick
This is the command used by the projects page:

java -cp /usr/share/java/phidget22.jar:/usr/share/java/phidget21.jar:. -jar buttonScanner.jar

Note that the classpath arg is specifying the current directory (.)

You can omit the phidget version you're not using.

-Patrick

Re: SBC4 Java works everywhere but internal

Posted: Fri Sep 07, 2018 6:49 am
by Gexleo
This worked quite well! Thank you!