Server cmd problem

James Davis

New Member
Jul 29, 2019
19
0
0
i am a noob when it comes to this kind of stuff
i am trying to set up a server for me and my friends to play on, but when i launch the .bat file for the server the cmd instantly closes after it opens
i am getting really frustrated with it now, can someone help me
 

tunnen

New Member
Jul 29, 2019
100
0
0
If you edit the batch file then add "PAUSE" to a line at the bottom, the cmd window should stop at a "Press any key." prompt. Which should keep the window open so you could see any command error that was thrown. For example, a failure to locate the system path to Java.

You could also open a command window separately (run cmd.exe) then run the batch file from there. The command window should not auto close upon finishing the batch file.

Above assuming you are using a Windows based computer.

Edit: I can't remember the batch file off the top of my head, but I think it was only one line that calls for Java to launch the server.jar. So that's why I'm going to assume that the actual issue is that the PATH variable isn't set correctly in Windows. (Basically Windows has no idea how to start Java in a command terminal.) If that is the case, check out http://java.com/en/download/help/path.xml
 

James Davis

New Member
Jul 29, 2019
19
0
0
okay, this is what comes up:
c:/Users/james/Desktop/FTBBetaA_server>java -Xmx512m -Xmx1G -jar FTB-Beta-A.jar
'java' is not recognized as an internal or external ocmmand, operable program or batch file.

thanks for the fast reply
 

tunnen

New Member
Jul 29, 2019
100
0
0
That would be the PATH issue I was refering to in my above message.

http://java.com/en/download/help/path.xml

the path to enter would be something similar to "C:\Program Files\Java\bin" making sure to add a semi-colon (;) to seperate from other paths.

"C:\Program Files\Java\bin" would vary depending on where you actually have the Java files installed on your computer.
 

Otto

New Member
Jul 29, 2019
2
0
0
This is probably really stupid, but how do I add ram to my server if I am on a mac? On a normal minecraft server I would use text edit on my start.command but that dosnt exist.
 

James Davis

New Member
Jul 29, 2019
19
0
0
I have my Java installed on my program files (x86) and i have tried what you have said Tunnen but it still will not work, i have edited the PATH but it still comes up with the error
 

James Davis

New Member
Jul 29, 2019
19
0
0
I am using Windows 7 as an operating system
i have Java runtime enviroment 7
and i am using kaspersky as a Anti virus
 

tunnen

New Member
Jul 29, 2019
100
0
0
Hmmm, after updating the PATH variable, did you close and re-open a new command prompt? Try opening a command prompt and typing "echo %path%" then hit enter. It should show you what the current PATH varible is set to. Ensure that the Java path is in there. Make sure there is also a semi-colon ";" in between the different paths. If it appears to be listed when you do "echo %path%" but still not working, could you copy/paste the output to here?

One more thing you could try, edit the batch file and change the line trying to launch the jar file (java.exe -Xmx512M -Xms2G -jar server.jar) and change it to:

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xmx512M -Xms2G -jar server.jar

Make sure to include the quotation marks (") around the path otherwise it'll complain at any spaces in the path. Keep in mind the path may also need to be edited to suit your installation. Same goes with the memory setup (-Xmx###M/G -Xms###M/G).

If that works, chances are it's something messed up with the system PATH variable. If that doesn't work, try reinstalling Java.


Sorry for the delay, but you caught me at the end of my work day yesterday, I was literally running out the door as I posted that last comment =P
 

James Davis

New Member
Jul 29, 2019
19
0
0
sorry about catching you at the end of your work :p
after following your advice i got this message:
C:\Users\James\desktop\FTBBetaA_Server>"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xmx512M -Zms1G -jar server.jar
Error: unable to access jarfile server.jar
C:\Users\James\Desktop\FTBBetaA_Server>pause

(i changed the max amout of ram because that is what i used to have it at)
 

tunnen

New Member
Jul 29, 2019
100
0
0
"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xmx512M -Zms1G -jar server.jar

Should be -Xms1G
Also replace server.jar with whatever the jar file in the server package is called. I just didn't know the name of the actual file off hand and my corporate overlords have blocked my access to download the file to check. I'm guessing it's something like FTB-Server-Beta.jar or something like that. It should be the big file in the main directory.
 

James Davis

New Member
Jul 29, 2019
19
0
0
the spelling mistakes were on my end, i was busy watching youtube :p
Error this time:
C:\Users\James\Desktop\FTBBetaA_Server>"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xms512M -Xms1G FTB-Beta_A.jar
Error occurred during initialization of VM
incompatible minimum heap sizes specified
which heap sizes are available for me to use?
 

tunnen

New Member
Jul 29, 2019
100
0
0
Oops, seems we are both having cases of typos =P I got the heap commands backwards. -Xms is the initial, -Xmx is the maximum, so try this one.

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xms512M -Xmx1G FTB-Beta_A.jar

Looks like you also used -xms for both... though might be another transcription error... I think you need to stop watching YouTube, and I need to go home from work. That, or perhaps I need more caffeine and a better memory. Or at least figure out a way to get Minecraft to work at the office... =P
 

James Davis

New Member
Jul 29, 2019
19
0
0
well, i changed it around like you told me to, fixed that problem but now another Error, i am going to skip the C:\ bit because that is plain boring to type out :D
Error: could not find or load main class FTB-Beta-A.jar
 

tunnen

New Member
Jul 29, 2019
100
0
0
While in the "C:\Users\James\Desktop\FTBBetaA_Server" directory in the command prompt, try

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xms512M -Xmx1G -cp . FTB-Beta_A.jar

There is a space on both sides of the period after -cp
 

James Davis

New Member
Jul 29, 2019
19
0
0
this one Error seems really hard to find an answer for, maybe i have done something wrong along the line?