Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start a java program without the console

I am trying to use this GUI mod for a Minecraft Server. I wrote a batch file so the server can start with more RAM. When I run just the .jar file, no command window opens and it runs just fine (of course with about 256mb ram) I was reading online that javaw starts a jar file without a command-line-console. But when I use javaw, the command console opens, but when I close it the program remains open. this is my batch file:

@echo off  "%ProgramFiles(x86)%\Java\jre6\bin\javaw.exe" -jar -Xms1024m -Xmx1024m crafty.jar  @echo on 

I don't understand java as well as most, so please try to be as clear as possible. Thanks

like image 807
tuxxi Avatar asked Apr 19 '11 02:04

tuxxi


People also ask

How do I run a Java program from a batch file?

1)open a notpad 2)copy and past this code and save this file as ex: test. bat 3)Double Click tha batch file. 4)put your java codes into the notepad and save it as N.B.:- save this java file same folder that your batch file exists. what's the purpose of opening up notepad when you just want to compile and run?

What is Javaw?

javaw.exe is a legitimate file from Sun Microsystems. It is an executable file used for displaying error messages, if they occur while installing any application. It's an essential Java file and it is typically located in c:\program by default.


1 Answers

If you want to start a java program without console popup under windows, this should be helpful: In command prompt type the following:

start javaw -jar -Xms1024m -Xmx1024m crafty.jar

If you want you can also write this as a batch file.

like image 84
RollingBoy Avatar answered Sep 19 '22 10:09

RollingBoy