Solved

Running jre in Dos

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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 …
Suggested Courses

739 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