JVM Arguments location?

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Donslayer

New Member
Jul 29, 2019
10
0
0
Everytime I execute /RESTART I end up instantly crashing the server. I find nothing in the logs, just the last lines shown in the console.

These are the lines I get:

Code:
[17:21:24] [Server thread/INFO] [/]: Attempting to restart with ./start.sh
[17:21:24] [Server thread/INFO] [FML/]: Java has been asked to exit (code 0) by cpw.mods.fml.common.FMLCommonHandler.exitJava(FMLCommonHandler.java:635).
[17:21:24] [Server thread/INFO] [FML/]: If this was an unexpected exit, use -Dfml.debugExit=true as a JVM argument to find out where it was called

So I've been trying to add this -Dfml.debugExit=true to my server startup arguemnts, but that only stops the server from starting up.

Yes, I've tried googling it, but it looks like none has answered this question before, or maybe Im completly blind.

All help much appriciated!
Thank you.

TL;DR. Where do I put -Dfml.debugExit=true?
 

condensedapple

New Member
Jul 29, 2019
44
0
0
In your start.sh, there should be the actual "java" line (begins with "java" or "$JAVACMD), followed by a lot of arguments (e.g. -jar, -server, -Xms, -Xmx, etc.) and then, the name of your server.jar (*.jar). Put your argument anywhere in the argument list (before -jar). That _should_ do the thing.
 
  • Like
Reactions: Robijnvogel

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
The java command line looks like this:

Code:
 path_to_jave.exe [arguments to java.exe such as -XMX] -jar path_to_application.jar [arguments for the application]

-Dfml* is an argument that must be passed to forge, and so must come AFTER the -jar .jar directive.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
The java command line looks like this:

Code:
 path_to_jave.exe [arguments to java.exe such as -XMX] -jar path_to_application.jar [arguments for the application]

-Dfml* is an argument that must be passed to forge, and so must come AFTER the -jar .jar directive.
Notice how it says .sh and is a server therefor its reasonably to asume it doesn't run on windows but on Linux. Because of this just java instead of path_to_java is enough and it also shouldn't have the .exe at the end.
Just writing this to prevent confusion :)
Also, on windows I believe that just java instead of the whole path is also enough amusing it is installed correctly.
 

Donslayer

New Member
Jul 29, 2019
10
0
0
Running server on windows. Starting the server with a .bat file. Lencas might have a point on the .sh, that windows wont execute it. Also, adding the debug to the serverstart.bat would be the correct way to proceed?

Thanks for all feedback, sorry for really late replay, been away for a few days.
 

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
If I am not mistaken - does it even matter? (a quick test confirmed that - I can use System.getProperty(String key) in both cases)

I am not familiar with Java development, but it was my understanding that the String array containing arguments that is passed to main() includes the arguments AFTER the -jar directive.