Solved

Running jre in Dos

Posted on 2002-05-20
5
230 Views
Last Modified: 2013-11-23
I downloaded the JDK from java.sun.com.  In dos I am using the command java application to run the application.  When the application runs the dos window is still open and shows all my debug statements.  My question is, does anyone know how to hide that dos window while my application is running.  I actually have an icon on my desktop whick I click and then calls a batch file to start off the java application. Is it even possible to hide that dow window and still allow my java application to run?
0
Comment
Question by:mfcrusty
5 Comments
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 200 total points
ID: 7022204
Have you tried javaw from the distribution? That is exactly the purpose for which it is intended.

Jim
0
 
LVL 9

Expert Comment

by:yongsing
ID: 7023065
You can archive your program .class files into an executable JAR file. On double-clicking the JAR file icon, the program will run. Here is how you create the JAR file. First, create a manifest file, say "test.mf", with the content as follows:

Main-Class: MyClass

MyClass is the name of the class which contains your static main() method. Note that there must be a newline character at the end of the line.

Then archive all the files as follows:

jar cmf0 test.mf Test.jar *.class

where Test.jar is the name of the JAR file, and *.class means all the .class files in the current directory.

Now that you have the JAR file, all you need to run it is to double-click its icon.
0
 
LVL 35

Expert Comment

by:girionis
ID: 7023473
 Yongsing I do not think this is what mfcrusty asked

>  My question is, does anyone know how to hide that dos
> window while my application is running.

  mfcrusty, I would actually go with the solution jim_cakalic has suggested.
0
 

Author Comment

by:mfcrusty
ID: 7027919
Thanks Jim.  I never knew what that was for.  I am a Java certified programmer and I never used javaw.  I always wondered what that command did but it was never required of me to use it.  Thanks again.  
0
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 7027988
S'okay. There's more there than any of us can possibly remember.

Jim
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 128
split string containing \r\n in Java 46 38
servlet filter example 37 46
hibernate insert example 13 14
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now