Java error could not create the java Virtual machine

i was trying to run the optifine installer and got the error below:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Did you already read what google says ?

However, because OptiFine is a Java application, you'll need to get Java to use OptiFine. Go to the **Java SE 16** download page and download the installer for your operating system.26.07.2021

Welcome to Manjaro! :smiling_face_with_three_hearts:

  1. Please read the information behind this link. It will help you to post necessary information.
  1. Please press the three dots below your post and then press the :pencil2:
  • If you give us information about your system, we can see what we’re talking about and make better suggestions.
  • You can do this by using inxi in a terminal or in console.
sudo inxi --admin --verbosity=7 --filter --no-host --width
  • Personally identifiable information such as serial numbers and MAC addresses are filtered out by this command
  • Presenting the information in this way allows everyone to be familiar with the format and quickly find the items they need without missing anything.
  1. Copy the output from inxi (including the command) and paste it into your post.
  • To make it more readable, add 3 backticks ``` on an extra line before and after the pasted text.

Have you already :mag: for your problem in the forum ? (Wisdom lies in reading :wink: )