SeHoon
SeHoon

Reputation: 11

Why does an exe file made with java immediately turn off?

I made a jar in eclipse and converted it from jsmooth to exe. The exe is created, but if I double-click it, it turns off immediately. Is my code the problem?

public class plz {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        System.out.println("Hello World!");
        for(int i = 0; i< args.length; i++) {
            System.out.format("args[%d}: %2 %n", i, args[i]);
        }

    }
}

Upvotes: 0

Views: 94

Answers (1)

Vladimir Stanciu
Vladimir Stanciu

Reputation: 1536

Yes, it is. Your code states that it should loop through the list of arguments(which you provide when you start the application). Once this is done, the application will stop.

Upvotes: 1

Related Questions