Java / Minecraft “Error: Could not find or load main class –Xms1024M”
I am not a Linux pro nor a Java pro, but I am setting up a Minecraft server on Ubuntu 16.04. System has 8GB RAM.
I followed all the directions for setting up the server (which is very simple) but when I ran the command:
sudo java –Xms1024M -Xmx1024M -jar minecraft_server.1.9.2.jar nogui
I got this:
Error: Could not find or load main class –Xms1024M
I then simply ran (after about 1 hour of hacking around trying to install different JREs): sudo java -jar minecraft_server.1.9.2.jar nogui
and it worked.
What is the difference and what are the possible issues by not specifying RAM?
Additionally, what is a good practice for starting up the Minecraft server via SSH and letting it run in the background after disconnecting?
Edit:
When running java -jar minecraft_server.1.9.2.jar nogui
I am seeing this output:
2016-05-08 14:30:35,683 ERROR Cannot access RandomAccessFile {}) java.io.FileNotFoundException: logs/latest.log (Permission denied)
2016-05-08 14:30:35,684 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element RollingRandomAccessFile java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Followed by an endless list of these:
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
java minecraft jre
add a comment |
I am not a Linux pro nor a Java pro, but I am setting up a Minecraft server on Ubuntu 16.04. System has 8GB RAM.
I followed all the directions for setting up the server (which is very simple) but when I ran the command:
sudo java –Xms1024M -Xmx1024M -jar minecraft_server.1.9.2.jar nogui
I got this:
Error: Could not find or load main class –Xms1024M
I then simply ran (after about 1 hour of hacking around trying to install different JREs): sudo java -jar minecraft_server.1.9.2.jar nogui
and it worked.
What is the difference and what are the possible issues by not specifying RAM?
Additionally, what is a good practice for starting up the Minecraft server via SSH and letting it run in the background after disconnecting?
Edit:
When running java -jar minecraft_server.1.9.2.jar nogui
I am seeing this output:
2016-05-08 14:30:35,683 ERROR Cannot access RandomAccessFile {}) java.io.FileNotFoundException: logs/latest.log (Permission denied)
2016-05-08 14:30:35,684 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element RollingRandomAccessFile java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Followed by an endless list of these:
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
java minecraft jre
Yes, good point. When I remove sudo, it's now a different issue. Please see edit. I did this once on a Raspberry PI and it was no issues at all, except it was too slow.
– Jason
May 8 '16 at 21:30
1
Looks like it created some files in your home directory owned by root, since that is who you ran it as the first time, and now you don't have access to them. Runsudo chown -R yourname ~
to make everything owned by you again.
– psusi
May 8 '16 at 21:57
add a comment |
I am not a Linux pro nor a Java pro, but I am setting up a Minecraft server on Ubuntu 16.04. System has 8GB RAM.
I followed all the directions for setting up the server (which is very simple) but when I ran the command:
sudo java –Xms1024M -Xmx1024M -jar minecraft_server.1.9.2.jar nogui
I got this:
Error: Could not find or load main class –Xms1024M
I then simply ran (after about 1 hour of hacking around trying to install different JREs): sudo java -jar minecraft_server.1.9.2.jar nogui
and it worked.
What is the difference and what are the possible issues by not specifying RAM?
Additionally, what is a good practice for starting up the Minecraft server via SSH and letting it run in the background after disconnecting?
Edit:
When running java -jar minecraft_server.1.9.2.jar nogui
I am seeing this output:
2016-05-08 14:30:35,683 ERROR Cannot access RandomAccessFile {}) java.io.FileNotFoundException: logs/latest.log (Permission denied)
2016-05-08 14:30:35,684 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element RollingRandomAccessFile java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Followed by an endless list of these:
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
java minecraft jre
I am not a Linux pro nor a Java pro, but I am setting up a Minecraft server on Ubuntu 16.04. System has 8GB RAM.
I followed all the directions for setting up the server (which is very simple) but when I ran the command:
sudo java –Xms1024M -Xmx1024M -jar minecraft_server.1.9.2.jar nogui
I got this:
Error: Could not find or load main class –Xms1024M
I then simply ran (after about 1 hour of hacking around trying to install different JREs): sudo java -jar minecraft_server.1.9.2.jar nogui
and it worked.
What is the difference and what are the possible issues by not specifying RAM?
Additionally, what is a good practice for starting up the Minecraft server via SSH and letting it run in the background after disconnecting?
Edit:
When running java -jar minecraft_server.1.9.2.jar nogui
I am seeing this output:
2016-05-08 14:30:35,683 ERROR Cannot access RandomAccessFile {}) java.io.FileNotFoundException: logs/latest.log (Permission denied)
2016-05-08 14:30:35,684 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element RollingRandomAccessFile java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Followed by an endless list of these:
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
at kx.a(SourceFile:44) [minecraft_server.1.9.2.jar:?]
at kx.b(SourceFile:54) [minecraft_server.1.9.2.jar:?]
java minecraft jre
java minecraft jre
edited May 8 '16 at 21:51
muru
1
1
asked May 8 '16 at 21:20
JasonJason
110115
110115
Yes, good point. When I remove sudo, it's now a different issue. Please see edit. I did this once on a Raspberry PI and it was no issues at all, except it was too slow.
– Jason
May 8 '16 at 21:30
1
Looks like it created some files in your home directory owned by root, since that is who you ran it as the first time, and now you don't have access to them. Runsudo chown -R yourname ~
to make everything owned by you again.
– psusi
May 8 '16 at 21:57
add a comment |
Yes, good point. When I remove sudo, it's now a different issue. Please see edit. I did this once on a Raspberry PI and it was no issues at all, except it was too slow.
– Jason
May 8 '16 at 21:30
1
Looks like it created some files in your home directory owned by root, since that is who you ran it as the first time, and now you don't have access to them. Runsudo chown -R yourname ~
to make everything owned by you again.
– psusi
May 8 '16 at 21:57
Yes, good point. When I remove sudo, it's now a different issue. Please see edit. I did this once on a Raspberry PI and it was no issues at all, except it was too slow.
– Jason
May 8 '16 at 21:30
Yes, good point. When I remove sudo, it's now a different issue. Please see edit. I did this once on a Raspberry PI and it was no issues at all, except it was too slow.
– Jason
May 8 '16 at 21:30
1
1
Looks like it created some files in your home directory owned by root, since that is who you ran it as the first time, and now you don't have access to them. Run
sudo chown -R yourname ~
to make everything owned by you again.– psusi
May 8 '16 at 21:57
Looks like it created some files in your home directory owned by root, since that is who you ran it as the first time, and now you don't have access to them. Run
sudo chown -R yourname ~
to make everything owned by you again.– psusi
May 8 '16 at 21:57
add a comment |
2 Answers
2
active
oldest
votes
Specifying RAM
The issues by not specifying RAM is pretty simply that your Minecraft server won't have enough RAM reserved for it, causing it to crash. Have you tried putting the RAM commands at the end, like so:
java -jar minecraft_server.jar -Xmx8192M
Be sure to adjust the RAM to your limits. Note, additionally, that you do not need to specify -Xms
in your arguments. Be sure to also not use sudo
, as that opens up the possibility for system compromise.
Using Minecraft in the background
You can run Minecraft in the background in many different ways. I've listed a few below as an example.
Method 1: screen
You can run a Minecraft session in the background using a nifty utility known as screen
. You can do this by just running the screen
command, followed by your start command. Afterwards, just press Ctrl + A followed by D. You'll come back to a terminal. To resume your screen
session, just run screen -r
.
Most people prefer screen
because you can go back and access the console at any time.
Method 2: bg
/fg
After your Minecraft server has started, press Ctrl+Z on your keyboard. From there, type bg
. Your Minecraft server will be running in the background.
Note that I have not personally tested it, so YMMV.
Method 3: nohup
Prepend your start command with the nohup
command. After your Minecraft server has started, just close your SSH session. The server will keep running.
Be careful using nohup
though, because it will use up a LOT of hard drive space keeping its own logs. You can avoid this by appending >/dev/null 2>&1
to the end of the command.
Method 4: Initscripts
Initscripts are very complicated, but it lets your server auto-start/stop on boot or on manual invocation. Instructions are available online. There are many good methods, but they need to be tailored to your system.
Permission Errors
Your permissions problem is because Minecraft created all of its files as root. Therefore only root can access them. Fix this by running sudo chown -R $USER:$USER .
in the Minecraft folder.
Source: Sysadmin for a Minecraft network
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
@Jason: For Minecraft servers,764
and664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use644
as my permission node for the jarfile, but it really doesn't matter.
– Kaz Wolfe
May 8 '16 at 21:52
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
add a comment |
Pay attention to case!
The m
should be lower case, like so:
sudo java -Xms1024m -Xmx1024m -jar minecraft_server.1.9.2.jar nogui
Also, try putting the memory options at the end.
Caution:–
is not-
! After all I think that's the main problem, java understands bothm
andM
as units, seeman java
.
– dessert
Dec 9 '17 at 13:05
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f769498%2fjava-minecraft-error-could-not-find-or-load-main-class-xms1024m%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Specifying RAM
The issues by not specifying RAM is pretty simply that your Minecraft server won't have enough RAM reserved for it, causing it to crash. Have you tried putting the RAM commands at the end, like so:
java -jar minecraft_server.jar -Xmx8192M
Be sure to adjust the RAM to your limits. Note, additionally, that you do not need to specify -Xms
in your arguments. Be sure to also not use sudo
, as that opens up the possibility for system compromise.
Using Minecraft in the background
You can run Minecraft in the background in many different ways. I've listed a few below as an example.
Method 1: screen
You can run a Minecraft session in the background using a nifty utility known as screen
. You can do this by just running the screen
command, followed by your start command. Afterwards, just press Ctrl + A followed by D. You'll come back to a terminal. To resume your screen
session, just run screen -r
.
Most people prefer screen
because you can go back and access the console at any time.
Method 2: bg
/fg
After your Minecraft server has started, press Ctrl+Z on your keyboard. From there, type bg
. Your Minecraft server will be running in the background.
Note that I have not personally tested it, so YMMV.
Method 3: nohup
Prepend your start command with the nohup
command. After your Minecraft server has started, just close your SSH session. The server will keep running.
Be careful using nohup
though, because it will use up a LOT of hard drive space keeping its own logs. You can avoid this by appending >/dev/null 2>&1
to the end of the command.
Method 4: Initscripts
Initscripts are very complicated, but it lets your server auto-start/stop on boot or on manual invocation. Instructions are available online. There are many good methods, but they need to be tailored to your system.
Permission Errors
Your permissions problem is because Minecraft created all of its files as root. Therefore only root can access them. Fix this by running sudo chown -R $USER:$USER .
in the Minecraft folder.
Source: Sysadmin for a Minecraft network
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
@Jason: For Minecraft servers,764
and664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use644
as my permission node for the jarfile, but it really doesn't matter.
– Kaz Wolfe
May 8 '16 at 21:52
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
add a comment |
Specifying RAM
The issues by not specifying RAM is pretty simply that your Minecraft server won't have enough RAM reserved for it, causing it to crash. Have you tried putting the RAM commands at the end, like so:
java -jar minecraft_server.jar -Xmx8192M
Be sure to adjust the RAM to your limits. Note, additionally, that you do not need to specify -Xms
in your arguments. Be sure to also not use sudo
, as that opens up the possibility for system compromise.
Using Minecraft in the background
You can run Minecraft in the background in many different ways. I've listed a few below as an example.
Method 1: screen
You can run a Minecraft session in the background using a nifty utility known as screen
. You can do this by just running the screen
command, followed by your start command. Afterwards, just press Ctrl + A followed by D. You'll come back to a terminal. To resume your screen
session, just run screen -r
.
Most people prefer screen
because you can go back and access the console at any time.
Method 2: bg
/fg
After your Minecraft server has started, press Ctrl+Z on your keyboard. From there, type bg
. Your Minecraft server will be running in the background.
Note that I have not personally tested it, so YMMV.
Method 3: nohup
Prepend your start command with the nohup
command. After your Minecraft server has started, just close your SSH session. The server will keep running.
Be careful using nohup
though, because it will use up a LOT of hard drive space keeping its own logs. You can avoid this by appending >/dev/null 2>&1
to the end of the command.
Method 4: Initscripts
Initscripts are very complicated, but it lets your server auto-start/stop on boot or on manual invocation. Instructions are available online. There are many good methods, but they need to be tailored to your system.
Permission Errors
Your permissions problem is because Minecraft created all of its files as root. Therefore only root can access them. Fix this by running sudo chown -R $USER:$USER .
in the Minecraft folder.
Source: Sysadmin for a Minecraft network
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
@Jason: For Minecraft servers,764
and664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use644
as my permission node for the jarfile, but it really doesn't matter.
– Kaz Wolfe
May 8 '16 at 21:52
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
add a comment |
Specifying RAM
The issues by not specifying RAM is pretty simply that your Minecraft server won't have enough RAM reserved for it, causing it to crash. Have you tried putting the RAM commands at the end, like so:
java -jar minecraft_server.jar -Xmx8192M
Be sure to adjust the RAM to your limits. Note, additionally, that you do not need to specify -Xms
in your arguments. Be sure to also not use sudo
, as that opens up the possibility for system compromise.
Using Minecraft in the background
You can run Minecraft in the background in many different ways. I've listed a few below as an example.
Method 1: screen
You can run a Minecraft session in the background using a nifty utility known as screen
. You can do this by just running the screen
command, followed by your start command. Afterwards, just press Ctrl + A followed by D. You'll come back to a terminal. To resume your screen
session, just run screen -r
.
Most people prefer screen
because you can go back and access the console at any time.
Method 2: bg
/fg
After your Minecraft server has started, press Ctrl+Z on your keyboard. From there, type bg
. Your Minecraft server will be running in the background.
Note that I have not personally tested it, so YMMV.
Method 3: nohup
Prepend your start command with the nohup
command. After your Minecraft server has started, just close your SSH session. The server will keep running.
Be careful using nohup
though, because it will use up a LOT of hard drive space keeping its own logs. You can avoid this by appending >/dev/null 2>&1
to the end of the command.
Method 4: Initscripts
Initscripts are very complicated, but it lets your server auto-start/stop on boot or on manual invocation. Instructions are available online. There are many good methods, but they need to be tailored to your system.
Permission Errors
Your permissions problem is because Minecraft created all of its files as root. Therefore only root can access them. Fix this by running sudo chown -R $USER:$USER .
in the Minecraft folder.
Source: Sysadmin for a Minecraft network
Specifying RAM
The issues by not specifying RAM is pretty simply that your Minecraft server won't have enough RAM reserved for it, causing it to crash. Have you tried putting the RAM commands at the end, like so:
java -jar minecraft_server.jar -Xmx8192M
Be sure to adjust the RAM to your limits. Note, additionally, that you do not need to specify -Xms
in your arguments. Be sure to also not use sudo
, as that opens up the possibility for system compromise.
Using Minecraft in the background
You can run Minecraft in the background in many different ways. I've listed a few below as an example.
Method 1: screen
You can run a Minecraft session in the background using a nifty utility known as screen
. You can do this by just running the screen
command, followed by your start command. Afterwards, just press Ctrl + A followed by D. You'll come back to a terminal. To resume your screen
session, just run screen -r
.
Most people prefer screen
because you can go back and access the console at any time.
Method 2: bg
/fg
After your Minecraft server has started, press Ctrl+Z on your keyboard. From there, type bg
. Your Minecraft server will be running in the background.
Note that I have not personally tested it, so YMMV.
Method 3: nohup
Prepend your start command with the nohup
command. After your Minecraft server has started, just close your SSH session. The server will keep running.
Be careful using nohup
though, because it will use up a LOT of hard drive space keeping its own logs. You can avoid this by appending >/dev/null 2>&1
to the end of the command.
Method 4: Initscripts
Initscripts are very complicated, but it lets your server auto-start/stop on boot or on manual invocation. Instructions are available online. There are many good methods, but they need to be tailored to your system.
Permission Errors
Your permissions problem is because Minecraft created all of its files as root. Therefore only root can access them. Fix this by running sudo chown -R $USER:$USER .
in the Minecraft folder.
Source: Sysadmin for a Minecraft network
edited May 8 '16 at 22:03
answered May 8 '16 at 21:37
Kaz WolfeKaz Wolfe
25.9k1374135
25.9k1374135
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
@Jason: For Minecraft servers,764
and664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use644
as my permission node for the jarfile, but it really doesn't matter.
– Kaz Wolfe
May 8 '16 at 21:52
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
add a comment |
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
@Jason: For Minecraft servers,764
and664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use644
as my permission node for the jarfile, but it really doesn't matter.
– Kaz Wolfe
May 8 '16 at 21:52
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
His server has 8GB of RAM. How can he not have enough?
– Android Dev
May 8 '16 at 21:40
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
@AndroidDev Fixed to be more clear and concise.
– Kaz Wolfe
May 8 '16 at 21:44
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
There were a few piece in all answers that helped, but this was the most complete. Thank you all. Part of the issue was permissions. I read elsewhere that I needed to chmod 764 to the jar. Additionally, the -Xmx2024M vs -Xms2024m doesn't seem to matter. 2G works as well.
– Jason
May 8 '16 at 21:49
@Jason: For Minecraft servers,
764
and 664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use 644
as my permission node for the jarfile, but it really doesn't matter.– Kaz Wolfe
May 8 '16 at 21:52
@Jason: For Minecraft servers,
764
and 664
are virtually the same, as the execute bit doesn't need to be set. Personally, however, I would use 644
as my permission node for the jarfile, but it really doesn't matter.– Kaz Wolfe
May 8 '16 at 21:52
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
See my comment below, you may want to adapt your answer.
– dessert
Dec 9 '17 at 13:10
add a comment |
Pay attention to case!
The m
should be lower case, like so:
sudo java -Xms1024m -Xmx1024m -jar minecraft_server.1.9.2.jar nogui
Also, try putting the memory options at the end.
Caution:–
is not-
! After all I think that's the main problem, java understands bothm
andM
as units, seeman java
.
– dessert
Dec 9 '17 at 13:05
add a comment |
Pay attention to case!
The m
should be lower case, like so:
sudo java -Xms1024m -Xmx1024m -jar minecraft_server.1.9.2.jar nogui
Also, try putting the memory options at the end.
Caution:–
is not-
! After all I think that's the main problem, java understands bothm
andM
as units, seeman java
.
– dessert
Dec 9 '17 at 13:05
add a comment |
Pay attention to case!
The m
should be lower case, like so:
sudo java -Xms1024m -Xmx1024m -jar minecraft_server.1.9.2.jar nogui
Also, try putting the memory options at the end.
Pay attention to case!
The m
should be lower case, like so:
sudo java -Xms1024m -Xmx1024m -jar minecraft_server.1.9.2.jar nogui
Also, try putting the memory options at the end.
edited Jan 6 at 10:32
David Foerster
27.9k1364110
27.9k1364110
answered May 8 '16 at 21:26
Android DevAndroid Dev
10.7k63259
10.7k63259
Caution:–
is not-
! After all I think that's the main problem, java understands bothm
andM
as units, seeman java
.
– dessert
Dec 9 '17 at 13:05
add a comment |
Caution:–
is not-
! After all I think that's the main problem, java understands bothm
andM
as units, seeman java
.
– dessert
Dec 9 '17 at 13:05
Caution:
–
is not -
! After all I think that's the main problem, java understands both m
and M
as units, see man java
.– dessert
Dec 9 '17 at 13:05
Caution:
–
is not -
! After all I think that's the main problem, java understands both m
and M
as units, see man java
.– dessert
Dec 9 '17 at 13:05
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f769498%2fjava-minecraft-error-could-not-find-or-load-main-class-xms1024m%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Yes, good point. When I remove sudo, it's now a different issue. Please see edit. I did this once on a Raspberry PI and it was no issues at all, except it was too slow.
– Jason
May 8 '16 at 21:30
1
Looks like it created some files in your home directory owned by root, since that is who you ran it as the first time, and now you don't have access to them. Run
sudo chown -R yourname ~
to make everything owned by you again.– psusi
May 8 '16 at 21:57