TheSenate
Posts: 2
Joined: Thu Jun 18, 2020 2:27 am

64-bit Java on RPi4

Thu Jun 18, 2020 2:32 am

So I'm trying to run Minecraft server for my friends and I to use. I have a Raspberry Pi 4B with 8GB RAM, and I want to dedicate 4 out of the 8 gigs to the server. When I try to do so, the Java output is:

Code: Select all

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.
I'm assuming this is because the installed version of Java is 32-bit, which is limiting the maximum amount of memory available to the VM. I followed the instructions at viewtopic.php?t=250730 to use the 64-bit kernel, but I'm unsure of how to use a 64-bit installation of Java. Any help would be much appreciated.

fruitoftheloom
Posts: 25219
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: 64-bit Java on RPi4

Thu Jun 18, 2020 8:07 am

TheSenate wrote:
Thu Jun 18, 2020 2:32 am
So I'm trying to run Minecraft server for my friends and I to use. I have a Raspberry Pi 4B with 8GB RAM, and I want to dedicate 4 out of the 8 gigs to the server. When I try to do so, the Java output is:

Code: Select all

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.
I'm assuming this is because the installed version of Java is 32-bit, which is limiting the maximum amount of memory available to the VM. I followed the instructions at viewtopic.php?t=250730 to use the 64-bit kernel, but I'm unsure of how to use a 64-bit installation of Java. Any help would be much appreciated.

RaspiOS ARMHF is by default 32bit Kernel and 32bit Userland, changing to the 64bit Kernel it is 64bit Kernel and 32bit Userland.


There is now a a testing version of RaspiOS ARM64 which is 64bit Kernel and 64bit Userland

http://downloads.raspberrypi.org/raspio ... 020-05-28/
The information is out there....you just have to let it in.

My other Linux machine is a ChromeBox

TheSenate
Posts: 2
Joined: Thu Jun 18, 2020 2:27 am

Re: 64-bit Java on RPi4

Thu Jun 18, 2020 11:49 am

fruitoftheloom wrote:
Thu Jun 18, 2020 8:07 am
TheSenate wrote:
Thu Jun 18, 2020 2:32 am
So I'm trying to run Minecraft server for my friends and I to use. I have a Raspberry Pi 4B with 8GB RAM, and I want to dedicate 4 out of the 8 gigs to the server. When I try to do so, the Java output is:

Code: Select all

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.
I'm assuming this is because the installed version of Java is 32-bit, which is limiting the maximum amount of memory available to the VM. I followed the instructions at viewtopic.php?t=250730 to use the 64-bit kernel, but I'm unsure of how to use a 64-bit installation of Java. Any help would be much appreciated.

RaspiOS ARMHF is by default 32bit Kernel and 32bit Userland, changing to the 64bit Kernel it is 64bit Kernel and 32bit Userland.


There is now a a testing version of RaspiOS ARM64 which is 64bit Kernel and 64bit Userland

http://downloads.raspberrypi.org/raspio ... 020-05-28/
Wow, sounds promising. So would that let me create the 4GB JVM? Also, is there anything I have to do with my installation of Java (right now, I have default-jdk installed).

bullen
Posts: 408
Joined: Sun Apr 28, 2013 2:52 pm

Re: 64-bit Java on RPi4

Tue Jul 21, 2020 1:26 pm

I'm struggling with this too, I tried downloading Linux ARM 64 Hard Float ABI: https://www.oracle.com/java/technologie ... loads.html

But it gives HeadlessException!

Where can we find 64-bit Java?

Edit: found it, sudo apt-get install openjdk-11-jdk
Last edited by bullen on Wed Jul 22, 2020 12:00 am, edited 1 time in total.
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

knute
Posts: 646
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: 64-bit Java on RPi4

Tue Jul 21, 2020 10:43 pm

bell-sw.com

msk
Posts: 1
Joined: Wed Jan 13, 2021 10:37 am

Re: 64-bit Java on RPi4

Wed Jan 13, 2021 10:46 am

bullen wrote:
Tue Jul 21, 2020 1:26 pm
I'm struggling with this too, I tried downloading Linux ARM 64 Hard Float ABI: https://www.oracle.com/java/technologie ... loads.html

But it gives HeadlessException!

Where can we find 64-bit Java?

Edit: found it, sudo apt-get install openjdk-11-jdk
bullen,

I am also trying to install 64 bit java on RPi4, may I know the OS details on which your able to install 64 bit java?
I tried install java 64 bit on raspberry pi 32 bit version, but it failing with error package not found.

fruitoftheloom
Posts: 25219
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: 64-bit Java on RPi4

Wed Jan 13, 2021 1:07 pm

msk wrote:
Wed Jan 13, 2021 10:46 am
bullen wrote:
Tue Jul 21, 2020 1:26 pm
I'm struggling with this too, I tried downloading Linux ARM 64 Hard Float ABI: https://www.oracle.com/java/technologie ... loads.html

But it gives HeadlessException!

Where can we find 64-bit Java?

Edit: found it, sudo apt-get install openjdk-11-jdk
bullen,

I am also trying to install 64 bit java on RPi4, may I know the OS details on which your able to install 64 bit java?
I tried install java 64 bit on raspberry pi 32 bit version, but it failing with error package not found.

You can run Raspberry Pi ARM64 Beta Operating System, and install openjdk from the repositories:

http://downloads.raspberrypi.org/raspio ... 020-08-24/


After install you will need a full upgrade:

Code: Select all

sudo apt update
sudo apt full-upgrade
sudo reboot

The ARM64 release is based of Debian Buster ARM64 and therefore 64bit kernel and userland.
The information is out there....you just have to let it in.

My other Linux machine is a ChromeBox

Return to “Java”