Solved

Running jre in Dos

Posted on 2002-05-20
5
217 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

10 Experts available now in Live!

Get 1:1 Help Now