I have researched this topic on the site, and tried the solutions but nothing that has worked for me so far. I have created a simple program in IntelliJ that compiles just fine, but when I export and make it into a JAR there are errors because of the images. When I take away the images I am able to build and load the JAR file correctly. I keep my image in the SRC file in a sub folder named sample.
public class Main extends Application {
Image image = new Image(String.valueOf(getClass().getResource("/buttona.png")));
Button button1 = new Button("", new ImageView(image));
Button button2 = new Button();