0

On Ubuntu

java -XshowSettings:vm throws:

VM settings: Max. Heap Size (Estimated): 1.00G Using VM: OpenJDK Server VM

I tried editing /etc/profile as in another post to no avail

java -version throws:

openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04) OpenJDK Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)

The command I am trying to run is:

java -Xmx4G -Xms4G -jar server.jar nogui

Which throws:

Invalid maximum heap size: -Xmx4G The specified size exceeds the maximum representable size. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

Cannot for the life of me figure out how to fix this. I installed 64-bit java but whatever is already on here takes priority it seems and if I remove is then /usr/bin/java has a fit.

Owen
  • 23
  • 5
  • How much free memory is available on your system? – Ivo Mori Jun 07 '20 at 23:58
  • 1
    Sounds like your _real_ question is how to access the newly-installed 64-bit version of Java without breaking your existing installation. We have no information about how you approached that or what happened when you tried using it, other than that something "has a fit" (perhaps, while we're at it, we could avoid denigrating epileptics? their lives are hard enough as it is. thanks) – Asteroids With Wings Jun 07 '20 at 23:59
  • @IvoMori 6 gigs free. – Owen Jun 08 '20 at 00:02
  • @AsteroidsWithWings Followed this (https://www.java.com/en/download/help/linux_x64_install.xml#download) exactly. Just ran it really :/ I'm afraid I do not understand what you mean by denigrating epileptics. – Owen Jun 08 '20 at 00:04
  • 2
    If you only did the steps of https://www.java.com/en/download/help/linux_x64_install.xml#download then your environment properly isn't set up correctly. There are other ways for installing JDKs on Ubuntu. For example, have a look at https://linuxize.com/post/install-java-on-ubuntu-18-04/. Also you may want to consult (or move your question to) the [__AskUbuntu__](https://askubuntu.com) StackExchange site and/or see [How to set default Java version?](https://askubuntu.com/questions/121654/how-to-set-default-java-version) there. – Ivo Mori Jun 08 '20 at 00:20

0 Answers0