Click to See Complete Forum and Search --> : Hiding command prompt in applications


agent_x91
10-11-2004, 02:00 PM
Does anyone know of any way to hide or close the command line in a java application without closing the program? I want to close the command line but keep the java window open.

Khalid Ali
10-11-2004, 05:37 PM
I hope I understood you correctly(:D )...make a clickable jar file and then click on it to run the app....

ray326
10-11-2004, 11:03 PM
Maybe what you're asking for relates to using javaw to run the app rather than java.

agent_x91
10-12-2004, 08:16 AM
make a clickable jar file


aha that sounds like the answer to me:) erm... how?:)

Khalid Ali
10-12-2004, 01:34 PM
create the jar file using your own manifest.mf file and make sure that
manifest file points to the class that has the main method in it.

Class-Name:package.MyClassName

you should be able to find more info on google about this...if you come accross any issues..post your errors and question ....

agent_x91
10-12-2004, 01:58 PM
using your own manifest.mf file

err... manifest.mf file? explain?:)

Khalid Ali
10-12-2004, 03:50 PM
just create a jar file using the following line of code

jar cvf jarfilename.jar folder/*.*

the above will create a jar file named "jarfilename.jar"
if you open up this jar file using unzipping software such as WinRAR(etc), you will see that there is a file named manifest.mf. This file is a just a text file containing some info(nothing much at this point).
In this file you can tel the jar file that there is a file that has main method in it and when user clicks it will run that....I think you must do a google search for "Create a clickable jar"

Java_Warrior
10-12-2004, 04:38 PM
Originally posted by agent_x91
Does anyone know of any way to hide or close the command line in a java application without closing the program? I want to close the command line but keep the java window open.

Creating a JAR file is useful, but I think that you may find that you will have great difficulty creating a MANIFEST.MF file and successfully using the JAR command, especially if you use packages to sort your classes. A better approach for simple programs would be to create a shortcut to your Java program using the JAVAW command.

If you do decide to create a JAR file, you will need to include the Main-Class attribute so that the VM knows which class contains your main method.