I know that similar questions were asked before here. But I couldn't make mine work somehow. Here are the steps that I tried already.
I created a bat file as javaw -Xmx200m -jar C:\Path\to\jarfile\TheJar.jar
and put in the startup folder. It worked for the current user. This doesn't help because I want to run this file for all users once they login to PC.
I created key value as HKEY_local_machine>software>microsoft>windows>current version >run and put it the samething in the string value. That didn't work either.
So I have windows 10 64 bit machines and the jar file needed to be placed on those computers. Once any user login, the jar file needs to run. But I couln't make that so far.
The first way you can try to open JAR files is to add Java to Windows. Without it, Java apps will not run on Windows and the JAR files also will not be opened. So, in order to run .JAR files, you need to add JAVA to Windows. Now, here is the tutorial. Open Command Prompt.
If you’ve compiled a .jar archive on your own and would like to run the same on other PCs then a .bat file can help you with the same. To do so, first, open up any Windows Explorer window, click on the 3-dot menu icon and select ‘Options’. Now, go to the ‘View’ tab and uncheck the option ‘Hide extensions for known file types.’
Jarx is one of the Jar executors you can add to Windows by clicking Jarx-1.2-installer.exe on this page. Click the jarx.exe to run the software, which doesn’t really have a GUI as such (except an About jarx window). Then you can double-click Jar files to run them in Windows.
While you can extract JARs with archive software such as 7zip, you can’t run a pure Java JAR app as you would with other programs in Windows. Since that’s the case, we’ll cover how you can run a pure Java app JAR file in Windows.
Try the following:
Write a batch file as follow ans save it as *.bat or *.cmd:
start javaw -Xmx200m -jar C:\Path\to\jarfile\TheJar.jar
Save the file created in the startup folder for all users, which should be C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
It is important to pay attention on the folder, because if your used Windows + R and shell:startup
shortcut like I usually do, it will only work for the current logged user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With