aspose file tools*
The moose likes Java in General and the fly likes creat file .txt in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "creat file .txt in java " Watch "creat file .txt in java " New topic
Author

creat file .txt in java

wafa khan
Ranch Hand

Joined: Apr 29, 2013
Posts: 42
hi all of you

i creat a .bat to test an application java on unit of command , i write this in file .txt
java -jar Class.java
and i rename the file exec.bat it working but the black window disppeared quickly what can i write to still the window opened
thank you
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13881
    
  10

wafa khan wrote:java -jar Class.java

If that is exactly what you put in your .bat file, it is not going to work. Instead of the name of a source file (Class.java), you need to specify the name of a JAR file. I guess you already know that, because you say it already works. But note that you need to be precise with what you write on the forum here.

To make the console window stay after your program has finished, add a 'pause' command at the end of the batch file. So, the contents of your .bat file might look like this:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
wafa khan
Ranch Hand

Joined: Apr 29, 2013
Posts: 42
thank you for your help .. it's right
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creat file .txt in java
 
Similar Threads
Open url from url list
DataInputStream Help needed while creating file
Run Java at specified time
New to Java
add timestamp with .txt file & write some information to the .txt file