Click the "Options..." in the launcher to change your Java and RAM settings.
By default, the launcher detects the best Java version and launches the game with that, but you can override the Java version with your own. You need to find the path to Java first, and then you can enter it into the options dialog. (Note: You don't need a "bin" folder when you enter the path.)
If you're on Windows, look in your
C:\Program Files\Java and
C:\Program Files (x86)\Java folder.
Warning: Java versions in the x86 folder on Windows are 32-bit, but you should use 64-bit Java when possible (if your computer supports 64-bit, which nearly every modern computer does).
In the options dialog, you can choose your "maximum memory (MB)" option to change Java's RAM usage.
If you do not have 64-bit Java installed, you cannot use more than 3 GB of RAM (most likely), and sometimes even not that much. Make sure you have 64-bit Java installed.
After increasing the RAM amount, if you get crash errors immediately on start, it's probably because you have 32-bit Java installed and not 64-bit Java, so the launcher cannot use that much RAM.
If you need help with any of this, ask on our forums or on Discord.