• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Compile JavaFX project on Raspberry Pi, Error: "Could not find or load main class..."

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Code Ranchers,

When I attempt to compile a java FX project on raspberry Pi, I get the message, "Error: Could not find or load main class GUI", where GUI is my main class.

I am coding on MacOS with NetBeans and compling to Raspberry Pi over SSH. See here: https://www.instructables.com/id/Efficient-Development-of-Java-for-the-Raspberry-Pi/

My program compiles perfectly on MacOS in NetBeans. Compiling over SSH results in the error. A runnable JAR is generated on the rPi when I try to compile over SSH. When I try to run this JAR in terminal with "java -jar WITPhoneHome.jar", I get the same error.

I am running java version "1.8.0.211" on the rPi. Also running Java8 on MacOS.

I manually installed Java8 to rPi from here: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Any suggestions are welcomed.
 
Bartender
Posts: 209
14
Mac OS X IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First I would check contents of this jar file:

and check the manifest file as well
 
Sheriff
Posts: 7126
185
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you post the command you issue in SSH?  Do you have a package statement in your Java code?
 
andrew mcnamara
Greenhorn
Posts: 22
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys,

Many thanks for your replies. I was able to solve this issue by figuring out WHICH package I was missing. JavaFX is missing in the Pi.

I fixed it by installing the jars using instructions here:
https://stackoverflow.com/questions/38359076/how-can-i-get-javafx-working-on-raspberry-pi-3

Thanks again.
 
Look! It's Leonardo da Vinci! And he brought a tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic