Yearly Archives: 2018


Google Hash Code 2018 – Results of the Hubs we Organized

Online Qualification Round

Position in Merged Ranking Position in Local Ranking Team Hub Score
1 1 Coffee Transistors Greece / NTUA ECE 49196020
2 2 Entropy Sources Greece / NTUA ECE 49051760
3 3 Veni Vidi Vsync Greece / NTUA ECE 46694239
4 1 Happy Trolls Cyprus / Cyprus University of Technology 45615170
5 4 lambdatron Greece / NTUA ECE 41908173
6 5 cuckooHashers Greece / NTUA ECE 41891579
7 2 Halloumium Cyprus / Cyprus University of Technology 41451768
8 1 Cheesy Coders Cyprus / University of Cyprus 39960712
9 6 NTUAwannaCODE Greece / NTUA ECE 39264060
10 2 MIP-MAP Cyprus / University of Cyprus 39013961
11 3 iPemberMen Cyprus / Cyprus University of Technology 37970348
12 4 UndefinedIsNotAFunction Cyprus / Cyprus University of Technology 34840916
13 7 111 Greece / NTUA ECE 33623110
14 8 Bits Plz Greece / NTUA ECE 33048131
15 9 #include<wraio_prama.h> Greece / NTUA ECE 31335747
16 3 #Patates Antinaxtes – XM Cyprus / University of Cyprus 30789367
17 10 Bill^2 Greece / NTUA ECE 30224719
18 11 λambda Greece / NTUA ECE 30209240
19 12 ntua67P Greece / NTUA ECE 18527523
20 13 Milwaukee Bugs Greece / NTUA ECE 14469721
21 14 DeathRow Greece / NTUA ECE 14167166
22 4 Lab_Rats Cyprus / University of Cyprus 12074631
23 15 ReadX Greece / NTUA ECE 11868571
24 16 XM Athens #1 Greece / NTUA ECE 10122968
25 17 Ojama Geeks Greece / NTUA ECE 8480600
26 5 FourCats Cyprus / Cyprus University of Technology 8050139
27 18 Tea Debuggers Greece / NTUA ECE 6646478
28 19 gargaNTUAns Greece / NTUA ECE 1942966
29 20 Rocket 🚀 Greece / NTUA ECE 1767702
30 21 Positive Feedback Greece / NTUA ECE 586021
31 5 PC for ProCrastination Cyprus / University of Cyprus 458402
32 22 I hmmy. U ece? Greece / NTUA ECE 174687
33 6 CodeLovers Cyprus / University of Cyprus 10
34 7 miou-miou Cyprus / University of Cyprus 10
35 23 Googlee Greece / NTUA ECE 10
36 24 Coding freaks Greece / NTUA ECE 10

JavaFX: Could not execute Jar build from artifact, while we could execute from IntelliJ IDEA

One of the applications we recently build on IntelliJ IDEA was using JavaFX.

When executing the application from inside IntelliJ, it would work as expected and load the GUI.
On the other hand, when executing the jar file from the terminal, we would get the following error:

$ java -jar hello.jar 
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
	at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:221)
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:205)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
	at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
	at java.lang.Thread.run(Thread.java:745)
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: No toolkit found
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:217)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
	at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
	... 5 more

As the above information was not very helpful, we executed the jar again using the -Dprism.verbose=true directive to get more information from the error.

$ java -Dprism.verbose=true -jar hello.jar 
Prism pipeline init order: es2 sw 
Using java-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
GraphicsPipeline.createPipeline failed for com.sun.prism.es2.ES2Pipeline
java.lang.UnsatisfiedLinkError: Can't load library: /home/user/Projects/Java/hello/out/artifacts/amd64/libprism_es2.so
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1827)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
	at com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:68)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.prism.es2.ES2Pipeline.(ES2Pipeline.java:50)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
	at java.lang.Thread.run(Thread.java:745)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.UnsatisfiedLinkError: Can't load library: /home/user/Projects/Java/hello/out/artifacts/amd64/libprism_sw.so
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1827)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
	at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.prism.sw.SWPipeline.(SWPipeline.java:41)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
	at java.lang.Thread.run(Thread.java:745)
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
	at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:221)
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:205)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
	at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
	at java.lang.Thread.run(Thread.java:745)
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: No toolkit found
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:217)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
	at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
	... 5 more

From the new log, we could see that the application was trying to load some .so (libprism_es2.so and libprism_sw.so) files that were not available in LD_LIBRARY_PATH.
We used find, to locate them:


find / -name "libprism_es2.so" 2>/dev/null;

Then we updated the LD_LIBRARY_PATH variable to include the new path


export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/idea-IC/jre64/lib/amd64/;

java -jar hello.jar;

Note: Here we used the copies that were available in our IntelliJ IDEA installation.
It is not recommended as you need to deploy them per machine, but in our case it was OK as the development machine was the actual machine to use the tool as well.