When I run my Sponge Forge server with my start.bat file, I always get the message “Do you want to allow this app to make changes to your device” and over time this gets annoying. Is there any way to disable this? (The application is “Java SE Runtime Environment 8 Update 341”)
I have not restored any old files and I don’t think I downloaded the installer from an unofficial website. I have tried removing Java and reinstalling it from https://www.java.com/en/download/. I also tried running the batch file as administrator. This time it asks if the command prompt is allowed to make changes.
I tested it on a vanilla server: When I double click the jar file, it works fine, but when I try to run it with a batch file, the same error occurs.
Everything seems to be fine in the start.bat file:
Is the path of JAVA_HOME the same path as where you installed Java to?
The default install location is
c:/ProgramFiles/Oracle/Java/1.8_341/bin
It maybe that the Java your running from cmd (that will use the one located in java_home) is not the same as the one you have installed (when you double click it uses windows associated program - likely the one you installed)
You can see where your java_home is with the following command
echo %JAVA_HOME%
You can then find out where your Java installed to by searching for Java in your applications, then right clicking the Java update tool and then selecting “open file location”. After the new window pops up, click some whitespace on the bar with the path buttons and it will give you the path in the form of the javahome command
It works!
In my system path I found C:\ProgramFiles (x86)\Common Files\Oracle\Java\javapath
which was a folder with only java.exe, which confused me. I changed the path to my working java: C:\Program Files\Java\jre1.8.0_341\bin.
Now I don’t get this annoying message anymore.
Thank you so much!