'Could not open user_jvm_args.txt' when strictly running the .bat as admin
I've got the whole thread I've made on minecraft forge, which I'll link here:
https://forums.minecraftforge.net/topic/151665-1201-server-error-on-start-up-could-not-open-user_jvm_argstxt-strictly-when-running-on-admin/
That explains my current headache pretty well. Thanks in advance for the assistance. Also, I'll throw my .sh file in here as well for extra clarity and good measure.
Forge Forums
1.20.1 Server error on start up: "Could not open 'user_jvm_args.txt...
Greetings, I am Teka. Upon starting up a 1.20.1 server, with up to date Java 17, and the recommended Forge Server, the server fails to start automatically when running as admin, note I am the owner and admin of the box I am working on. It works when I do not run as admin, however without the jvm ...
196 Replies
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
run.sh
Requested by tekasupport
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by tekasupport#0
@Teka
Windows?
Windows doesnβt use .sh?
And Linux doesnβt use .bat
It's Windows, forgot to specify
So what is the .sh file
Itβs for Linux, not windows
Was asked to link it in gen chat when I originally started this convo
Yeah I figured, but was just asked to put it in. I have very little experience with Debian 10.
I use the .bat file
Which doesnβt work on Linux
Linux expects .sh, not bat
Yes
And windows expects .bat, not .sh
I have been using the .bat
Just someone requested I post it
So why donβt you throw your .bat file in?
Discord told me no
wtf even is in there for it to be this big
It's not a file size issue
I was told 'dangerous file type'
Just use markdown and copy it in text
On it
@echo off
REM Forge requires a configured set of both JVM and program arguments.
REM Add custom JVM arguments to the user_jvm_args.txt
REM Add custom program arguments {such as nogui} to this file in the next line before the %* or
REM pass them to this script directly
java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.3.0/win_args.txt %*
pause
There's the whole dealWhy canβt you just embed it into the same file
ie βjava -Xmx -Xms -jar server.jar -noguiβ
the flags into the .bat file?
Never thought of it
Want me to give it a shot?
β οΈ
Yes
Alright
Immediately failed again when running as admin, same error
Also, running without admin still fails to load with any args
@ππππΎππΎπΈ At this point I've got no idea what I'm doing wrong. I know it's not the large page memory args, I've got those allowed in my local policy, I just need the .bat to have admin privileges so it can use those args, and it dies before startup entirely, so it doesn't even generate a log. I apologized if I'm being incredibly dense, just new to all of this. Should I just ditch the large page memory args at this point and focus on the args not registering on startup? Or something else entirely
show startup flags
-Xmx24G -Xms16G -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov -XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:+PerfDisableSharedMem -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=23 -XX:G1ReservePercent=20 -XX:SurvivorRatio=32 -XX:G1MixedGCCountTarget=3 -XX:G1HeapWastePercent=20 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:MaxTenuringThreshold=1 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99 -XX:+UseLargePages -XX:LargePageSizeInBytes=2m
I'll give them a shot
Thanks for the help btw
Alright, now when running without admin, I get the error 'Unable to access jarfile server.jar'
well you need to change the name
The file it's calling to is the one in \libraries\net\minecraft\server\1.20.1 yes?
no?
where is your jar file
There's a couple, which is the confusion. There's the one in the folder path above, then there's these two here as well.
I haven't messed with anything in the folders, it's exactly as extracted
File path for those two is \libraries\net\minecraftforge\forge\1.20.1-47.3.0
why not have it in the same directory
file path can be relative or absolute
I'm not certain which jar file the server is calling to is the issue
@Teka you have a panel or anything setup, or just raw dogging it?
I'm just raw dogging it.
on linux or windows
W10Pro
so you are just running a powershell terminal
cmd
yeah basically so, what error you getting rn?
At base value, the issue I've made this thread for is detailed in the forum post I made at the top of this thread. 'Could not open user_jvm_args.txt' when running as specifically. Without running as admin, the server does boot, however it does not boot with any of the args I put in place. There's a log attached to the forum post as well, a fresh boot up and shut down without running as admin.
The reason I would like to run as admin is to use the large page memory args in the flag set
is cmd saying anything or nah
Which needs admin perms
cmd is showing the server boot up when I run the .bat without running as admin
When I do run as admin I get the following:
do you have java installed?
or well
the Correct version
Latest edition of Java 17 from Oracle, recommended by Forge
typically it shits itself out for 2 reasons
no java
or it really cant find user jvm args
recommended by forge?
how did you download it
Through Oracle's site
what mc version you trying to run?
1.20.1
https://adoptium.net/temurin/releases/?os=windows&version=17&arch=x64&package=any
pick either the jre or jdk.
BUT be sure you download the MSI
Latest Releases | Adoptium
Eclipse Adoptium provides prebuilt OpenJDK binaries ...
i trust adoptium more then oracle to do its shit
This will be a modded server, hence using Forge, however I'm just trying to get it to run vanilla before I even attempt to do anything with mods
I'll remove Oracle and install that, gimme just a sec
i personally select this with the install, works 99% of the time when running those versions of mc and what not
you can go down the path of Finding the file path and setting it on the variables file or whatever
actually
rq show a ss of your folder with the stuff?
main directory
Yeh, one sec
ty
File path: C:\Users\ -----\Documents\Minecraft 1.20.1 FORGE SERVER
can you send over the user_jvm file?
also not what i meant by that file path lolz
Thought it'd help somehow anyway
a bit
if the spaces between minecraft 1.20.1 are actual spaces
youd wanna remove it
servers dont like spaces to their directories
Gimme just a sec for the .txt, I have to email the file to myself since I'm using anydesk to connect to my serverbox
gotcha
you can just open the file up and copy paste it no?
also
anydesk allows internal file transfers...
I haven't gotten it to work, maybe I'm jus dumb
the file transfers?
agh i need something to connect to via anydesk one sec
my phone should work
Would you like me to just copy the text into here?
yeah thatll work
Xmx and Xms set the maximum and minimum RAM usage, respectively.
They can take any number, followed by an M or a G.
M means Megabyte, G means Gigabyte.
For example, to set the maximum to 3GB: -Xmx3G
To set the minimum to 2.5GB: -Xms2500M
A good default for a modded server is 4GB.
Uncomment the next line to set it.
-Xmx24G
-Xms16G
-XX:+UnlockExperimentalVMOptions
-XX:+UnlockDiagnosticVMOptions
-XX:+AlwaysPreTouch
-XX:+DisableExplicitGC
-XX:+UseNUMA
-XX:NmethodSweepActivity=1
-XX:ReservedCodeCacheSize=400M
-XX:NonNMethodCodeHeapSize=12M
-XX:ProfiledCodeHeapSize=194M
-XX:NonProfiledCodeHeapSize=194M
-XX:-DontCompileHugeMethods
-XX:MaxNodeLimit=240000
-XX:NodeLimitFudgeFactor=8000
-XX:+UseVectorCmov
-XX:+PerfDisableSharedMem
-XX:+UseFastUnorderedTimeStamps
-XX:+UseCriticalJavaThreadPriority
-XX:ThreadPriorityPolicy=1
-XX:AllocatePrefetchStyle=3
-XX:+UseG1GC
-XX:MaxGCPauseMillis=37
-XX:+PerfDisableSharedMem
-XX:G1HeapRegionSize=16M
-XX:G1NewSizePercent=23
-XX:G1ReservePercent=20
-XX:SurvivorRatio=32
-XX:G1MixedGCCountTarget=3
-XX:G1HeapWastePercent=20
-XX:InitiatingHeapOccupancyPercent=10
-XX:G1RSetUpdatingPauseTimePercent=0
-XX:MaxTenuringThreshold=1
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5.0
-XX:G1ConcRSHotCardLimit=16
-XX:G1ConcRefinementServiceIntervalMillis=150
-XX:GCTimeRatio=99
-XX:+UseLargePages
-XX:LargePageSizeInBytes=2m
ah
oops
no file path located
hmmmm
funny funny forge servers
i hate you forge
that batch file is Technically a editable file
let me check
I can edit the .bat
ooo
send the contents over plz
@echo off
REM Forge requires a configured set of both JVM and program arguments.
REM Add custom JVM arguments to the user_jvm_args.txt
REM Add custom program arguments {such as nogui} to this file in the next line before the %* or
REM pass them to this script directly
java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.3.0/win_args.txt %*
pause
thats it?
The whole deal, raw as it is without modification
:HUH:
thats
nothing
ok im giving you something that will be Better for you, for many reasons
instead of this Batch file bullshit
This is wonderous
we swapping over to ps1 files (aka powershell)
mainly because, serverpack creator is happy and has something called Variable text file, where you can add your flags, java path, and more in 1 place
i just need to
edit it to suit you
what forge version are you running?
47.3.0 methinks
kk
ima dm you these just in case
Of course
ok i sent em
ye
just so yk its not funny buissness, ps1 file is getable from serverpack creator (very handy tool) it has its data and everything inside if you wanna code read it
i changed the Variables to remove my java path, and also change the forge version to what you need
i also cannot write code, so the chances of me ratting you is like
0
Hey me too I also cannot code
I can barely code basic C#
:sad: welcome home
Thanks
shit at least you can do stuff
i can only do snap :YEP:
right right
i forgot a required set
We all have our autism hyperfocuseseses. Mine is Arma
step*
Ope
maybe
i had to on w11 maybe you will too
i had to authorize my powershell to run the ps1
Hey btw gonna say it again, thank you for your assistance. I am quite grateful
Run powershell as administrator, then run
Set-ExecutionPolicy RemoteSigned
. Read the prompt, enter A, and enter. This will allow us to run scripts.
yee np. this at least ik how to do, so im always happy to helpLet me send these over to my serverbox rq
if ik how to help, i help
so you have a windows serverbox
from where, and why :YEP:
I tried Linux. I am not smart
Also
Because Arma server architecture plays better on W10, especially with modlists
ah
fair
I did build this box specifically for A3, just looking to branch out into the unknown
gotchaa
whats the specs?
I'm the intel Xeon guy you spoke to in gen earlier.
ohhh
the dual uh 2667's?
i forgot which ones
and thats a ram speed tamz
:YEP:
my ram speeds...
If only minecraft server were multithreaded then I would have no problems but.
true
eh I want to try it anyways
never will π
uhh itll run OK
not best
not worst
kinda bad tho
I'm not expecting best, or good for that matter, the box wasn't built for MC
thats fair
Well
hm?
I can't send the ps1 file over gmail because it's dAnGeRoUs
what can you do
i mean
So gimme a sec while I logon to discord
you can if you really need to
on web
setup a filezilla server :YEP:
and sftp into it
lol
true
but thats like major work
for a file
and then some
I could do it but eh
discord is better
Alright the ps1 and variable files are in the main directory
nice
try to launch the ps1 file
right click the file and run with powershell
Running, writing request stream atm
This popped up while writing the request
The server has started though
mhm mhm
you sure you have 47.3.0?
That's the name of the files/folders
oops
?
ah ok strange
did you move any files from there?
Nope
can you ss the contents of that folder?
well it says Downloading
so ig its fine?
I mean server is up
oh
what now :hmm:
the flags?
Let me do a bit of reading in this log, see if the flags were actually recognized and read
kk
the only flags i had in that variables file was -xmx8g and -xms4g
Yeah Seems like those were working
Let me throw in the rest of the bs to see if it complains at all
to change java flags open the Variables file, and just throw in the flags you want π
The issue is I need to run as admin, windows isn't allowing me to do so with the ps1 file
hm?
oh simple fix
Tried making a shortcut and having the properties make it run as admin by default but that option is entirely greyed out
here let me rq do on my system to see if it CAN work
funny cuz the default powershell is still a shortcut :YEP:
C:\Users-----\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell
i use w11 so check if it is the same path
if not just press the windows key, file path, copy path, change the default powershell to run as admin
go back to og powershell, change launch file (instead of notepad) to be powershell from the path you copied and launch
well
hmm
didnt change for me :Sadge:
Does Powershell run as admin by default?
no
No
:StalkerThink:
hmmm
wellllllllllllll
technically you CAN run an admin powershell, cd into the directory and just launch the server from that :hmm:
That be kinda funky
Also I could just say screw the LargePage memory flags.
true
One thing, for garbage collection server side, do you recommend G1GC or ZGC
I've heard both are good and both are ass
Very contradictory
these NUMA flags are really nice
i am not a flags guy :Sadge:
Yeah me neither obviously
I'll give those a shot, why not
ye
It did not like that
hmm
MINECRAFT_VERSION=1.20.1
MODLOADER=Forge
MODLOADER_VERSION=47.3.0
LEGACYFABRIC_INSTALLER_VERSION=1.0.0
FABRIC_INSTALLER_VERSION=1.0.1
QUILT_INSTALLER_VERSION=0.9.2
MINECRAFT_SERVER_URL=https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar
NEOFORGE_INSTALLER_URL=NONE
JAVA_ARGS="java -Xmx24G -Xms16G -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov -XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:+PerfDisableSharedMem -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=23 -XX:G1ReservePercent=20 -XX:SurvivorRatio=32 -XX:G1MixedGCCountTarget=3 -XX:G1HeapWastePercent=20 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:MaxTenuringThreshold=1 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99 -XX:+UseLargePages -XX:LargePageSizeInBytes=2m -jar path/to/server.jar -nogui"
JAVA="java"
WAIT_FOR_USER_INPUT=true
That's how I inputted those args
yeah thats fine oh i see
get rid of these at the end
-jar path/to/server.jar -nogui
ope
yea missed that
is okie
the ps1 and variables are linked, so the ps1 has the java locations the variables has the flag mess
so variables should never attempt to Search for java itself unless ps1 is being a shit head and using the wrong java version
then you overwrite the JAVA="java" to the folder path of your java install
That makes sense
caveman login :duckstrong:
:pain:
Still no like
why
could not find or load main class java
:Sadge:
I'd like to think.. Maybe somehow it's not liking the lack of admin privilage due to the usage of large page mem
Gonna get rid of those flags
try to run with admin
also remove java at the start
let me try to launch these flags rq
strange i managed to launch mine
So it was another dumb moment, didn't remove the java at the beginning. I didn't run as admin, it works
this was the only error :YEP:
even with admin it doesnt fix that
:Wowza:
who wouldve thought
Do you have LargePage mem enabled in your localpolicy?
:huh:
no
I had to do that to even allow access to that function
probably not
gotcha
yeah i dont
You on W10?
W11
i dont need it so dwdw
im also updating my system in like
4 months
6?
somewhere around there
gotcha, well I couldn't help either way, idk how to enable it in 11 lol
lol no worries
anyways thats all right?
java works, server launchs, flags work
Gonna skim through this wall of text rq and try to connect
sure
funny thing, that ps1 + variables combo works on Any version :pain: have those 2 things (and some libraries folders) and itll run it np π
IT
works
You have greatly assisted me today
:thumbsupcat:
gotta train my brain somehow
And educated me on some things I made mistakes on to boot
Know that you are appreciated
we all do when starting new things so no sweat :thumbsupcat:
tyty β€οΈ you are as well π glad i could have helped
Huge thanks again. No longer shall I headbutt a wall till it cracks, you broke it down
:Innie_Thumbs:
lmfao, if you need help on minecraft stuff im always open to help
@Clyde
tamz_ has reached level 2!
Roles Added:
Level 2
you can now do !solved to close this place π
well Lock*
If you don't mind, I'd like to screenshot parts of this conversation for future reference. You approve of this?
idm feel free
Thanks
np
I shall close it now, one final thank you
!solved
post closed!
The post/thread has been closed!
Requested by tekasupport#0