Skip to content

Instantly share code, notes, and snippets.

@freyacodes
freyacodes / Dockerfile
Created October 19, 2018 23:57
Teamcity Java 11 agent
FROM jetbrains/teamcity-agent
RUN apt update && apt install wget && \
wget -c https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz && \
tar -xvf openjdk-11_linux-x64_bin.tar.gz && \
rm openjdk-11_linux-x64_bin.tar.gz && \
mkdir -p /usr/lib/jvm/jdk-11 && \
mv jdk-11*/* /usr/lib/jvm/jdk-11/ && \
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-11/bin/java" 1020 && \
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-11/bin/javac" 1020 && \
curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose && \
@androidfred
androidfred / javafx.md
Last active October 27, 2021 03:21
java.lang.ClassNotFoundException: javafx.util.Pair

java.lang.ClassNotFoundException: javafx.util.Pair happens because javafx.util.Pair and other classes from javafx.util are not included in OpenJDK. Options for resolving:

Switch class

Map.Entry<K, V> from java.util is similar to javafx.util.Pair.

Install java-openjfx

Install java-openjfx through your package manager. (or whatever means you used to install Java on your machine) Note that java-openjfx is compatible with OpenJDK8, not previous versions.

After installing java-openjfx, you may have to add it manually to your IDE SDK classpath. Eg in IntelliJ, you may have to go to Project Structure | SDKs | <select your SDK> | Classpath | + (the Classpath +, not the SDKs +) | and add /usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar (which should be there now that java-openjfx has been installed) | OK