SQLCL with Adoptopenjdk - windows-10

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.

Related

Kafka on RHEL gives me "Classpath Is Empty"

I'm trying to install Kafka 2.6.0 on a Red Hat VM. When I try to start Zookeeper, I get:
"Classpath is empty. Please build the project first..."
I have the following Java Version, which is Java 8 as far as I understand:
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-b10)
OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
Is there something I need to do to set a "Classpath" environment variable?
I updated .bashrc for my users and the Classpath error went away.
Source: https://computingforgeeks.com/how-to-set-java_home-on-centos-fedora-rhel

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

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.

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.

Why can not I run Intellij on Linux Mint for Java version error?

When I try to run intellij, it shows the following message-
Can not start under java 1.7.0_51-b13:Java 1.8 or later is required!
But when I checked the version of the Java in the machine-
java -version
I get-
java version "1.8.0_60" Java(TM) SE Runtime Environment (build
1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
What could be the reason for not working this?
Newer versions of IntelliJ IDEA explicitly require Java 8 to run.
Some things that can be done:
Uninstall older versions of Java
Ensure that which java points to the correct version of Java
Ensure that Java 8 is selected via update-alternatives --config java
Check the variables IDEA_JDK, JDK_HOME, and JAVA_HOME, and be sure they don't point to Java 7. If all else fails, IDEA defaults to whichever java is on the path, so unsetting those variables may be a viable option.
Can you check if you have a JAVA_HOME env variable set ? If yes, it might use this version instead of the java binary available in your path.

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