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”)
This is typically caused by Java not being installed with full admin rights and not to do with Java itself.
Perhaps you “installed” the portable edition though unofficial means? Or restored your old file system that included your Java version?
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:
java -Xmx1024M -Xms1024M -jar forge-1.12.2-22.214.171.12460.jar nogui
Is the path of
JAVA_HOME the same path as where you installed Java to?
The default install location is
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
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
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:
Now I don’t get this annoying message anymore.
Thank you so much!