Get rid of windows warnings when staring the server

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”)

Thanks alot!

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-14.23.5.2860.jar nogui

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

1 Like

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!

1 Like