Application crashing while launched with Java Webstart

Ok this is one of the most frustrating things i believe… the program works perfectly when you run it off your compiler… but once you pack it into a jar file and run it through web start… hell breaks loose.

This is my problem… I have a JFrame that I am painting graphics to…

well the first part of my application runs fine, asks for name (using JOptionpane), blah blah, but once it starts to create the JFrame and container, and create the window… it crashes… all the sudden… out of nowhere… and it doesnt even tell me anything, it just… crashes to desktop… has anyone had this problem before? ill post snippets of my code, but if you need more ill gladly post more.

now my guess is, since i never seen the screen go red, but i do see the grey area, is that the application is crashing before it even gets to the game loop.

Its possible, i just thought about this, could this be an error with not being able to find the SystemTimer that is located in a timer.jar file that i have located in my jar, mabye im just not packaging everything correctly… Because im not completely sure how to package 3rd party libraries that are needed into java webstart…

weblink: http://lightsoflifesoftware.n00bl33t.com/Gratorial/src/Gratorial.v.3.0.jnlp



try{
			device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
			oldDisplayMode = device.getDisplayMode();
			GraphicsConfiguration config = device.getDefaultConfiguration();
			container = new JFrame("Gratorial 2.0 Singleplayer",config);
			container.setUndecorated(true);
			container.setIgnoreRepaint(true);
			container.setResizable(false);
			
			System.out.println("FS"+device.isFullScreenSupported());
			System.out.println("DC"+device.isDisplayChangeSupported());
			
			if(device.isFullScreenSupported() && device.isDisplayChangeSupported() && fullscreenChoice == 0){
				device.setFullScreenWindow(container);
				FULLSCREEN = true;
				device.setDisplayMode(new DisplayMode(800,600,32,0));
				DISPLAYMODE = true;

container.setVisible(true);}else//create windowed mode 800x600
			
			container.createBufferStrategy(2);
			strategy = container.getBufferStrategy();
			
			container.addWindowListener(new WindowAdapter(){
				public void windowClosing(WindowEvent e){
					System.exit(0);
				}
			});
			container.addKeyListener(new KeyInputHandler());
			
			requestFocus();
			GAMESTART = SystemTimer.getTime(); //3rd party timer library
			initEntities();//creates the pictures and assigns entities tot hem.
			gameLoop();//starts game loop
}
public void gameLoop(){
		long lastLoopTime = SystemTimer.getTime();
		while(gameRunning){
			long delta = SystemTimer.getTime() - lastLoopTime;
			lastLoopTime = SystemTimer.getTime();
			
			lastFps += delta;
			fps++;
Graphics2D g = (Graphics2D)strategy.getDrawGraphics();
			g.setColor(Color.RED);
			g.fillRect(0,0,800,600);
			g.setColor(Color.YELLOW);

// blah blah blah blah, you get the point, it just draws and stuff...
}


have in mind I’m noob :stuck_out_tongue:
why do you use 3rd party timer? Why not java.lang.System.nanoTime() ?
if you’re suspecting on it, why don’t you just comment that part of program… I’m guessing you need it for fps calculation, put fps constant, comment timer and try it to see if it works.

nanoTime() is java 5.0 ? i think i did that a long time ago but i could never get it to work, ill go ahead and try nanoTime again…

Nope its not my timer that is causing the application to close…

guess nobody has any ideas?

never worked with applets or webstart… but I guess java keeps console logs after program runs (or crashes). Put System.out.println(“line x”); after each statement (line of code) and see how for you get in the program. A little noobish but it should work ;D

trust me, ive done that, but it hasnt helped me solve my problem the least little bit. I opened the log it creates, but it flashes by faster than i can read or take a screenshot. Nor does it create any logs… sigh it seems to be Windows closing the application, and having nothign to do with the code… which makes no sense.

[quote=“Sequalit”]I opened the log it creates, but it flashes by faster than i can read or take a screenshot.
[/quote]
huh? what log? where?
I know when you run java program a small cofee cup icon in notification area appears representing java jre… you can open it, go to console and see logs right? Try.
If not that try to output to something different… like sending data to a php page that will process it and save it to a file / database.

Anyway I strayed a little with that printing for debug… the fastest debug should be sensing what part of code could couse problems and then tempoearily exlcuding (commenting) it. Little by little and your application won’t crash and you’ll know what portion of code coused it. I mean you must have written and tested it little by little and not writing it all at once so at least you can guess where the problem might be.