Solved

Running jre in Dos

Posted on 2002-05-20
5
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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.
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

690 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