Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creat file .txt in java

 
wafa khan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
wafa khan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your help .. it's right
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic