[HowTo] Use default java in eclipse

This is a short one :wink:

1. Locate eclipse.ini

for zsh:
print -l /**/eclipse.ini
In my installation this was at /opt/eclipse-cpp/eclipse.ini

change the line after the line "-vm"

-vm
#plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_20.0.2.v20230801-2057/jre/bin/java

to:

-vm
/usr/lib/jvm/default/bin/java
#plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_20.0.2.v20230801-2057/jre/bin/java

Everytime you use archlinux-java set java ...... ,this will also set the java-version used by eclipse
or you could set the path to your prefered java-version for eclipse:

-vm
/usr/lib/jvm/java-21-openjdk-bin/bin/java
#plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_20.0.2.v20230801-2057/jre/bin/java

:footprints:

Does it really make sense to edit the packages file directly instead of making a wrapper script that wont be overwritten by updates?

(this is also what is suggested in the archwiki)

https://wiki.archlinux.org/title/Java#Launching_an_application_with_the_non-default_java_version

This works well with other Java programs.

But eclipse insists on using its own JVM from the INI file :man_shrugging:

Ah, well if its particularly stubborn then it does make sense :blush: