Home arrow static arrow Java Programming [Archive] - Hide Console Window
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Hide Console Window
This topic has 3 replies on 1 page.

Posts:19
Registered: 2/18/04
Hide Console Window  
Jun 21, 2004 6:54 AM



 
Hi,

This must be soo sily, but when i start my Java application from a shortcut, the shortcut target being java.exe -classpath "classpathgoeshere" ApplicationClassNameGoesHere

I get a console window that appears behind my app. How can I not show that console windows? I see a lot of Java application that will not display this and i'm wondering how it's being done!

Thanks,
XiNull
 

Posts:9
Registered: 1/28/03
Re: Hide Console Window  
Jun 21, 2004 7:04 AM (reply 1 of 3)



 
Use javaw.exe instead of java.exe
 

Posts:1,160
Registered: 7/24/97
Re: Hide Console Window  
Jun 21, 2004 8:16 AM (reply 2 of 3)



 
Or make your Application an executable jar file.
Pack your Application classes into a jar file. You need to modify the manifest like this.
Add
Main-Class=<fully qualified class name>
to the manifest.
You can now run your Application by double clicking on it. No DOS window will open either.
 

Posts:1,160
Registered: 7/24/97
Re: Hide Console Window  
Jun 21, 2004 8:29 AM (reply 3 of 3)



 
Or make your Application an executable jar file.
Pack your Application classes into a jar file. You
need to modify the manifest like this.
Add
Main-Class=<fully qualified class name>
to the manifest.
You can now run your Application by double clicking on
it. No DOS window will open either.
The Main-Class entry is incoorrect and should be
Main-Class: <fully qualified class name>
The space after the : is needed, without it the jar will not be executable
 
This topic has 3 replies on 1 page.