Starting java program automatically on windows

How to start a java program automatically on windows?

I have tried to write to AUTOEXEC.bat programmaticlly but i get an access denied excpetion, i also tryed manually puting the cammond in but theni get a noclassdeffound exception.

What do i need to do?

The fact that you get exceptions tells you the JVM does get laucnhed, just your classpath is not correct or your code is bugged.

That’s the place to look, and without any code, nobody can help you.

there are a number of ways you can start a program automatically on windows [just look at how spyware do it :slight_smile: ]

i would suggest making a batch (.bat) file and putting it in the ‘startup’ folder on the start menu, this will automatically launch the bat file on windows startup.

another way u can achieve this is through the registry but this is messy with java.

by the way using the autoexec.bat is from the dinosaur age and scarcly used nowaday :slight_smile:

SwTech has a few links about starting java programs as services on windows.

HTH

Endolf

the cmd i get that exception with is
java “path”
The path contains spaces however