SBC4 Java works everywhere but internal

General PhidgetSBC Discussion.
Gexleo
Fresh meat
Posts: 2
Joined: Tue Sep 04, 2018 2:33 pm
Contact:

SBC4 Java works everywhere but internal

Postby Gexleo » Tue Sep 04, 2018 2:38 pm

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

User avatar
Patrick
Lead Developer
Posts: 3046
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: SBC4 Java works everywhere but internal

Postby Patrick » Wed Sep 05, 2018 12:48 pm

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

Gexleo
Fresh meat
Posts: 2
Joined: Tue Sep 04, 2018 2:33 pm
Contact:

Re: SBC4 Java works everywhere but internal

Postby Gexleo » Fri Sep 07, 2018 6:49 am

This worked quite well! Thank you!


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest