Jar file, created by netbeans doesn't open anymore on windows?

Executing the jar in the terminal gives this exception trace.

Executing the jar in the terminal gives this exception trace: Exception in thread "main" java.lang. NullPointerException at javax.swing.ImageIcon.(ImageIcon. Java:155) at tbs.ImageLoader.

LoadImage(ImageLoader. Java:11) at tbs.Flag.(Flag. Java:21) at tbs.Model.(Model.

Java:58) at tbs.GameView.(GameView. Java:33) at tbs.GUI.(GUI. Java:36) at tbs.Main.

Main(Main. Java:6) So it looks like you had something like this here: public Image loadImage(String name) { return new ImageIcon(getClass(). GetResource(name)); } ... and the getResource() method returned null, which caused the ImageIcon constructor to throw the Exception.In line 21 of Flag.

Java you used "images/flagNeutral. Png" as the image string, but your jar file contains images/flagneutral. Png (inside the tbs directory).

See the difference? If it worked on your local system outside of the jar, you are using a case-insensitive file system there.(Windows or Mac?) In the jar, as well as over HTTP and on "real" file systems, the URLs are case sensitive, which means you have to name the resource precisely as the file is named. And yeah, normally you should have at least tried your program yourself, and posted the stack trace as well as the relevant code lines.

There may be a lib folder in the dist directory. If so, it contains jar files for any libraries you included. Make sure that is the case.

You need to distribute the jar as well as the entire lib folder and store both in the same folder just like Netbeans creates them. I am hoping you have created a Java application project and not a Java Class library project. You can check if the main-class attribute and any library paths are added properly when you "clean and build" the project.

You can run it like java -jar tbs. Jar and see the response.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions