So my problem is openjfx and using it on Scala-sbt project. The actual problem is JAVAFX_HOME path.
First of all I have java version 10.0.2 installed on my computer and openjfx (which I take as JavaFX) is on ubuntu repositories based on java 8jre (openjdk-8-jre is required). So when I install it needs another version of java.
But still after installing openjfx my sbt build will not open a project and gives an error
Caused by: java.util.NoSuchElementException: key not found: JAVAFX_HOME
I take that this since java current version is 10 and javafx is on 8. However when I try to do
update-alternatives --config java
and select version 8, java seems not to work on at all. The output of java --version says then:
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
So, Is there a way to export only javafx to .bashrc similar to this:
export JAVA_HOME="$(jrunscript -e 'java.lang.System.out.println(java.lang.System.getProperty("java.home"));')"
to get JAVAFX_HOME path working or do I have to reinstall java to java 8 somehow to get javafx working correctly?