OpenJDK 9 IntelliJ IDEA (Ubuntu) "Can't resolve Symbol" - linux

I recently installed openJDK 9 under Ubuntu 17.10 and it seems like IntelliJ IDEA has trouble with it.
Whenever I create a new project IntelliJ can find the JDK, but it seems like it's not configuring it the right way. Here is how it looks like
when I create a HelloWorld.java example it looks like this
and it says 'Can't resolve symbol 'String''.
Everything works fine when I compile via terminal and even with Eclipse.
When I type 'java --version' it says
openjdk 9-Ubuntu
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
Is there a way to fix this problem?

The problem is related to Debian packaging of openjdk-9 in the lib/jrt-fs.jar file. This file is compiled incorrectly.
This bug is reported here and there is a more complete Answer here.
If you insist to make use of openjdk you might wait for the new versions or try to build it from the source using the recommended options on the launchpad.

Related

SQLCL with Adoptopenjdk

I would like to understand some "magic", here is how to reproduce :
Get SQLCL here : https://www.oracle.com/fr/database/technologies/appdev/sqlcl.html
But SQLCL need jre 1.8 so get AdoptOpenJDK 8 here : https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot
When java_home is set and sqlcl in path :
c:\[...]> java -version
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_265-b01)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.265-b01, mixed mode)
c:\[...]> sql
This application requires a Java Runtime Environment 1.8.0_220
Two solution i found :
Install latest official JRE 1.8.
Copy jre from adoptopenjdk next (and NOT IN) to the sqlcl folder.
Note : i installed openjdk in the default folder but sqlcl in a custom one, on the same drive.
How do you explain that ?
(I would like to use openjdk so don't realy like the first solution, and find the second one a little dirty...)
The explanation for the second solution is that SQLcl is kind of part of SQL Developer. As if the folder SQLcl is inside the SQLDeveloper folder. And there, there is a jdk/jre folder.

How do I fix JavaFX runtime components are missing?

I have the following installed on Ubuntu 18.04.1 LTS:
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)
javafx.runtime.version=8.0.161
javafx.runtime.build=b00
However I try to run the sample java application that uses javafx I get the following error:
$ java -jar Untitled.jar
Error: JavaFX runtime components are missing, and are required to run this application
I have tried to run it in Eclipse, Intelli, and in the terminal with the same error.
I have set the classpath
:~$ echo $CLASSPATH
/usr/share/java/openjfx/jre/lib/ext/jfxrt.jar:.
I have copied all of the javafx files to the current directory.
I have tried everything I can find on the internet.
Does anyone know how to fix this?
On Ubuntu 18.04 with openjdk-11-jre and openjfx installed you could use:
% java --module-path /usr/share/openjfx/lib --add-modules ALL-MODULE-PATH \
-jar Untitled.jar
There is more information on how to run JavaFX programs at the openjfx.io site.

Haxe 3.4.0 installer used 'haxelib version' still reflects 3.3.0

I wanted to use Visual Studio Code for HaxeFlixel development and the Haxe extension noted that I needed Haxe 3.4.0. I went ahead and downloaded the new installer from the website and installed it on my laptop running Windows 10. However after installing it turned out that calling 'haxelib version' in the command prompt it still returned 3.3.0.
I tried rebooting. Uninstalling then rebooting and installing again. I could find nothing in the system environmental variables that could cause it. Tried updating the Haxe on my Desktop, and had the same issue. Which is running windows 8.1 on it.
Does someone know what might be the cause? Thank you for your time in advance.
To check the Haxe version, use haxe -version. haxelib is a separate application and can have a version number that's different from the compiler's version.
Haxelib 3.3.0 appears to be the version shipped with Haxe 3.4.0-rc.1.

Android Studio 2.2.2.0 on Mac does not start

I am having problems with all of the 2.2.x versions of Android Studio on my Mac. I have downloaded the 2.2.2.0, and when I run the app, I can see the icon comes up in the Dock briefly, and then goes away.
OS X:
Yosemite (10.10.5)
System Java:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
Note: This is the ONLY JRE I have on my system
Console Error:
10/22/16 11:03:21.548 AM studio[953]: allVms required 1.8*,1.8+
10/22/16 11:03:21.552 AM studio[953]: Cannot load JVM bundle: Error Domain=NSCocoaErrorDomain Code=3585 "The bundle “OpenJDK 8” couldn’t be loaded because it doesn’t contain a version for the current architecture." (dlopen_preflight(/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib): no suitable image found. Did find:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: mach-o, but wrong architecture) UserInfo=0x7f845610 {NSLocalizedRecoverySuggestion=Try installing a universal version of the bundle., NSFilePath=/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib, NSLocalizedFailureReason=The bundle doesn’t contain a version for the current architecture., NSLocalizedDescription=The bundle “OpenJDK 8” couldn’t be loaded because it doesn’t contain a version for the current architecture., NSDebugDescription=dlopen_preflight(/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib): no suitable image found. Did find:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: mach-o, but wrong architecture, NSBundlePath=/Applications/Android Studio.app/Contents/jre/jdk}
Any suggestions would be greatly appreciated, as I've been trying to figure this out for quite some time.
Try install Java SE 1.8
Add JAVA_HOME to PATH in mac
$ touch .bash_profile
In bash_profile, add
export JAVA_HOME=`/usr/libexec/java_home`
$ echo $JAVA_HOME
You will see something like
/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home
Since Android Studio v2.2 (AS) uses its own bundled OpenJDK 8, any other installed JDKs are not the issue. The solution is to install AS (either dragging from the mounted DMG or unzipping) anywhere except the Applications folder.
For whatever reason, when AS resides in Applications, it raises the error posted in the question. I would be very interested to know the reason, but after wasting countless hours, I am simply relieved it is running.

32-bit linux based eclipse giving error on startup in Fedora 12

I downloaded the 32-bit eclipse for my 32-bit fedora 12. I extracted the tar.gz without any error. But when i click on the eclipse executable, i am getting the error:
"Failed to load the JNI shared library "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/../lib/i386/client/libjvm.so"
"
I am not able to resolve this error. Please inform how to proceed.
Regards,
Go to your eclipse folder
Open eclipse.ini file and check if there is -vm option set properly
Else set -vm in one line followed by your jdk installed bin folder.
Hope this helps yo solve your problem.
I'd suggest avoiding OpenJDK, as Eclipse will keep complaining about it.
So, navigate to http://java.com/en/download/manual.jsp and download appropriate Sun's Java package (32 or 64 bit, depending on your current installation). As Fedora uses RPMs for package management, I advise to use that method.
Then, after installation, run java -version in terminal, you should get something like:
$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

Resources