Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Java application at Windows startup

I have a JAR file containing a Java application. How can I make it start with Windows, without needing user interaction?

like image 394
shan Avatar asked May 10 '11 16:05

shan


People also ask

Can Java app run on Windows?

Is Java supported in Windows 10? Yes, Java was certified on Windows 10 starting with Java 8 Update 51.


1 Answers

Create a .bat file and put this inside:

javaw -Xmx200m -jar C:\Path\to\jarfile\TheJar.jar

Then put the .bat file into the windows startup folder.

One more thing: There's a difference between using java and javaw. While java is better when you are debugging an application, the application prints text or something like that, javaw is better when you don't need that. Why? Because java runs java program using a console that shows all that application prints (println's, exception stacktraces and so on) while javaw doesn't run on console.

like image 87
MikeKusold Avatar answered Oct 11 '22 01:10

MikeKusold