IntelliJ add Java 11 - intellij-idea

I need to add my installed Java 11 version to the project settings, because of this error (Error:java: invalid source release: 11).
When i go to project structure -> Project settings -> Project there it just shows Java 1.8.
When i try to add "java-11-openjdk-amd64" it fails with the reason "The selected directory points to a JRE, not a JDK.".
java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)

The java application is available in the Java Runtime Environment (JRE). The fact that java is available in version 11 does not necessarily mean that the Java Development Kit (JDK) is also installed for version 11. However, IntelliJ needs the JDK which includes tools like the compiler javac.
In order to use Java 11 in IntelliJ, you need to install the Java 11 JDK.
For example on Ubuntu you can do that by executing:
sudo apt install openjdk-11-jdk

Related

Is jboss 4.2.2 GA compatible with java 11?

We have a product that is running fine with JBoss 4.2.2/java 7.
We are now moving to JDK 11. simply added java 11 in the classpath and tried starting the server.
Encountered below error
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
-Djava.endorsed.dirs=C:\PathBuilder\GE\EMEA\vp\jboss\lib\endorsed is not supported. Endorsed standards and standalone APIs in modular form
will be supported via the concept of upgradeable modules.
removed below configurations from run.bat and started the server again
-XX:MaxPermSize=128m
"-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%"
now getting below error and which is
interrupting the ear deployment Caused by:
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.omg.CORBA.Object
Is Java 4.2.2 compatible with JDK 11 or we need to update JBoss to 7.2 or latest versions?
can someone help with this or provide related links?
JBoss 4.2 is a very old and outdated version and it only tested with JDK 1.5 and 1.6 version. If you are upgrading your JDK to 11 then you should update the JBoss to 7.3 version which is the latest available GA release from Red Hat.
You can download the jdk files of older versions like jdk6 and then replace JAVA path in the jboss run file from "set JAVA=%JAVA_HOME%\bin\java" to
"set JAVA=C:\Users\jdk1.6.0_45\bin\java"
Of course it's better to upgrade to a higher JBoss version... But in case that's not possible, you can avoid the ClassNotFoundException for org.omg.CORBA.Object by placing rt.jar from Java 8 in your JBoss-libs folder.
With this configuration you can run older JBoss versions with Java 11.

Netbeans installer issue with jdk 11

I downloaded and installed jdk 11 and am now trying to install netbeans 8.2. But i get an error which states "JAVA SE was not found on this computer.Make sure JDK is properly installed and run installer again. You can specify valid JDK location using --javahome installer argument."
I created a JAVA_HOME variable and set the value to "C:\Program Files\Java\jdk-11.0.1\bin" and set the same value for PATH variable as well.
How do i fix this?
You face a couple of issues:
NetBeans 8.2 requires JDK 8, and it will not work with any version of Java > 8.
NetBeans does not yet support JDK 11, though the release of a new version which does (NetBeans 10) is imminent.
The easiest approach would be to remove JDK 11 (unless you need it for other reasons apart from NetBeans), install Java 8 then reinstall NetBeans 8.2. It used to be possible to download NetBeans 8.2 bundled with Java 8, but if you try that now Oracle will just redirect you to the Apache NetBeans 9.0 web site.
There is a newer release of NetBeans than 8.2, Apache NetBeans 9.0. While it supports Java 9 and Java 10, it also does not support Java 11.
Updated to reflect that NetBeans 10 was released on December 27, 2018:
If you really want to use Java 11 with NetBeans you can download the latest Jenkins build of the beta version of NetBeans 10 at your own risk.
If you want to use Java 11 with NetBeans then download NetBeans 10.0. The download is a zip file and it works on all platforms.
Find netbeans.conf file in C:\Program Files\NetBeans 8.1 RC\etc.
In that atlas you'll find the netbeans_jdkhome. Set it accordingly.
You can specify the JDK to use by installing from the command line. So install a JDK 8 (e.g. Azul Zulu Open JDK 8) and then launch the netbeans installer:
netbeans-8.2-javaee-windows.exe --javahome "c:\Program Files\Zulu\zulu-8"
Once the installation starts, you will be asked which JDK to use for the IDE; make sure to choose your JDK 8 instead of the JDK 11. I have used this to install NetBeans 8.2RC successfully on Windows 10.

IntelliJ IDEA seems to not fully switch to the new jdk

I am stuck with the following problem regarding Intellij IDEA.
I had installed the following java version:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
on my Win7 PC and using Intellij IDEA v14.1.3.
After some time, I have upgraded my jdk and now I have installed the following:
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)
I have consequently changed all the references to point to the new jdk in system variables and in Intellij in Project structure ...
Everything seemed to work fine (when I run a program from Intellij I see that the command java is invoked from the right path).
The problem is that for some reasons, when I open the integrated terminal in Intellij and write java -version the result is the old version (1.7.0_51).
I realized this because of some issues of the old version of java I face when I run my unit tests that should have been resolved in the new version.
Have anybody any idea how to solve this?
Thank you in advance!
I would not only update the java version, but completely delete it from the machine. Obviously, you have not removed all the references to the old java, as your problem statements describes.
Maybe the Java Uninstall tool might be helpful for this? Then make a clean new installation.

Android Build Error: Unable to locate Java VM. Please set JAVA_HOME environment variable

I'm using Ti Studio on Win7, and my project builds and works when I have my Android plugged in via USB and I run using "Android Device".
However, when I try to buid it for distribution I get:
[ERROR] Program launch failed. Unable to locate Java VM. Please set JAVA_HOME environment variable.
I have looked at this thread which describes a similar problem, and verified that JAVA_HOME is set:
+>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_29
Also, in Ti Studio I have verified that Preferences->Studio->Platforms->Android has the "Android SDK Home" set to the path where Android SDK is installed.
Can anyone guide me on what else I need to do to fix this?
Thanks!
UPDATE FOR ANAND
+>javac -version
javac 1.6.0_29
+>java -version
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
Did you read System Requirements?
From Documentation:
For Windows, the 32-bit version of Java JDK is required regardless of
whether Titanium is running on a 32-bit or 64-bit system.
Try to install additional 32bit version of Java (without removing the 64bit) and set the system variable.
You may refer this answer.
Hope it helped you
Configure environment variables as mentioned here and JDK must be 32 bit

How do i configure WebLogic 8.1 to use a specific JRE / JDK on my development machiine

How do i configure WebLogic 8.1 to use a specific JRE / JDK on my development machine. I realized that it is using hot spot and i would like to change it to run on JRockit.
You need to change the JAVA_VENDOR setting in the setDomainEnv.sh/.cmd file (depending whether you are running a Linux or Windows box).
Adding/changing the following lines to the start of your setDomainEnv file should work:
set JAVA_VENDOR=BEA
set BEA_JAVA_HOME=(path to your jrockit installation, e.g. c:\BEA\jrockit)
Now you should start the server. You can monitor, in the console (stdout), the indication about which Java version is being used:
starting weblogic with Java version:
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2105-windows-ia32, compiled mode)
It is also possible to do it during the configuration wizard, when you are adding a domain, under the Java SDK Selections tab.