r/javahelp • u/leifk3 • Jul 20 '21
Solved Can't create executable jar file
Hey guys,
i use Bluej for programming java (it's for school) and we made a little project with JFrames, etc... I didn't want to open bluej everytime just to start the program so I wanted to export it to a .jar file.
BlueJ includes this feature so I only have to say which is the class with the main-method and if I want to download the java libraries too.
That's fine but if I now open the Jar file there's just this error:
"error a jni error has occurred please check your installation and try again"
this is my class with the main-method: (is there my mistake?)
public class Simulation
{
private Controller controller;
private Login_Model lm;
private Game_Model gm;
public static void main(String[] args) {
new Simulation();
}
public Simulation() {
lm = new Login_Model();
gm = new Game_Model();
controller = new Controller(lm, gm);
}
}
0
Upvotes
1
u/[deleted] Jul 20 '21
You might want to search for a BlueJ specific forum. This is a generic Java forum, and you're telling us what you did in BlueJ.
Some "generic Java" instructions I can give is this. A JAR file is actually a zip file. What files do you see if you rename your JAR file to a ZIP file and unzip it?