IntelliJ Git plugin can't seem to find Java Runtime - java

When trying to perform any git actions on my IntelliJ, I get the below error:
0 file committed, 11 files failed to commit: Documentation updates, error message updates
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
Which is unusual because everything else on the editor works - the code completion, running maven, even the tests. So if I am not mistaken, IntelliJ is identifying a Java Runtime but for some reason the Git plugin is not picking it up.
Running Git in the normal terminal works fine and the application executes on the terminal. What is causing this issue?
My IntelliJ about is as follows:
IntelliJ IDEA 2020.3.3 (Community Edition)
Build #IC-203.7717.56, built on March 15, 2021
Runtime version: 11.0.10+8-b1145.96 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12

Resolved.
Turns out the issue was on the Git plugin, which did not honor the $JAVA_HOME variable on my environment. Executing Git in terminal is fine, presumably because zsh/bash is honoring Java location more explicitly, but executing through Git plugin or Github failed.
Either that Git has issues picking up Java in *nix environments where env variables are more obfuscated, or my company's terrible Mac OS estate bungled the installation. Or both.

Related

NetBeans 12.4 "Warning - could not install some modules: JavaFX wrapper"

I get the following message after exiting out of NetBeans and then re-starting.
Warning - could not install some modules: JavaFX wrapper - No module providing the capability org.openide.modules.jre.JavaFX could be found. Another module could not be installed due to the above problems.
I am using Java 15, with JavaFX. I didn't have the issue with 12.3 and Java 15, but now I get it at least once a day, depending on how often I leave and re-enter.
I have a work-around. I replace the NetBeans cache with a clean copy kept for this purpose, and I can then restart and continue working without the error, but this is a bit tedious after the first couple of times, each day.
Product Version: Apache NetBeans IDE 12.4
Java: 15.0.4; OpenJDK 64-Bit Server VM 15.0.4+5-MTS
Runtime: OpenJDK Runtime Environment 15.0.4+5-MTS
System: Windows 10 version 10.0 running on amd64; UTF8; en_AU (nb)
I have found the solution, I have re-installed, and skipped the installation of the nb-javac plugin. I had forgotten that I did this on my older installations, until I re-read the post below. Everything is fine now.
NetBeans plugin fails if nb-javac installed
What's "nb-javac" in Apache NetBeans?

Cannot run program "C:\Program Files\Java\jdk1.8.0_202\bin\java.exe" Malformed argument has embedded quote: -Djava.endorsed.dirs=

ERROR: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\bin\java.exe" (in directory "C:\Users\USERNAME\AppData\Local\JetBrains\IntelliJIdea2020.3\compile-server"): Malformed argument has embedded quote: -Djava.endorsed.dirs=
I keep getting this error everytime I Redeploy my Spring Boot project via weblogic server in IntelliJ IDE.
The first time I deploy, everything works just fine. But when I Redeploy the project in order to effect new changes, this error comes up.
My Tools:
IntelliJ IDEA 2020.3 (Ultimate Edition)
WebLogic Server Version: 12.2.1.3.0
Windows 10
Java (JDK) version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
What I have Tried:
I only have one installed JDK and JRE version: 1.8.0_202 installed on my PC
Deleted javaws.exe, javaw.exe & java.exe fields from my Sys32 Folder (A Googled Solution)
Able to view my Java version on cmd when I run: java -version
Path to my jdk is correct: C:\Program Files\Java\jdk1.8.0_202\bin\java.exe
IntelliJ is correctly pointing to my JDK folder JDK Linked to My IntelliJ IDE
My Weblogic configurations look just fine: My Weblogic configurations
I also encountered the same problem.
The reason is that I installed the FindBugs plugin.
You can try to add the following line of parameters to the idea64.exe.vmoptions.
-Djdk.lang.Process.allowAmbiguousCommands=true
For those that need help finding the VM options in the IDE. I'm using IntelliJ IDEA 2021.1 by the way.
On the IDE Toolbar at the top -> click HELP -> Edit Custom VM Options...
Then add this VM option at the bottom (uncluding the hyphen '-' symbol):
-Djdk.lang.Process.allowAmbiguousCommands=true

IntelliJ IDEA - How to enable code completion / debugging for Java files in non-java project

Often I will have a big repo full of various bits and pieces (some bash, php, config dumps etc). It is often convenient to be able to open as a single project from the root of the repo.
However when a Java file is thrown into the mix IntelliJ doesn't seem to accept that it is Java and will not have all the helpful debugging / package import magic.
How can I force this to be enabled?
(Taking the java file out, putting it in a Project/src directory and then opening that Project directory as a project will make things work fine - but this is annoying for simple scratch files).
In case it makes any difference I am running:
IntelliJ IDEA 2020.1.1 (Ultimate Edition)
Build #IU-201.7223.91, built on April 30, 2020
Licensed to Ingmar Boddington
Subscription is active until December 2, 2020
Runtime version: 11.0.6+8-b765.40 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.4
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Non-Bundled Plugins: io.gulp.intellij, com.jetbrains.php
Configure a new Java module with the source roots set to the folders with your Java files.

SQLDEVELOPER: JDK Not Found with JDK-11 installed

when running $sqldeveloper in order to open the app it returns the next message:
Default JDK not found
Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/adri/.sqldeveloper/19.2.1/product.conf
I'm in ubuntu and there goes some info about my jdk installation:
$sudo update-alternatives --config java
There is 1 choice for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 auto mode
* 1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
$ls /usr/lib/jvm/
default-java java-1.8.0-openjdk-amd64 openjdk-11
java-11-openjdk-amd64 java-8-openjdk-amd64
$ls java-11-openjdk-amd64/bin/
jconsole
When typing java-11-openjdk-amd64 in the sqldeveloper opened terminal (as it was asked) it turns into that message:
Error: java-11-openjdk-amd64/bin/java not found or not a valid JDK
So the file 'java' is needed but I don't have it :C
Thanks for attention.
Bests,
I'm unable to add a comment as I am a new user here but I am wondering if there is something not quite right or missing in your environment.
I just created an Ubuntu 18.04 VM to match your o/s and used the Synaptic Package Manager to install openjdk-11-jdk (which installed a couple dependent packages as well). Here are the packages this process installed:
• openjdk-11-jdk
• openjdk-11-jdk-headless
• openjdk-11-jre
• openjdk-11-jre-headless
As thatjeffsmith mentioned the JDK is required (so that SQL Developer can use the JDWP debugging capabilities).
I then unzipped the following SQL Developer package which I had previously downloaded:
• sqldeveloper-19.2.1.247.2212-no-jre.zip
After changing to the correct directory (~/Applications/sqldeveloper/19.2/sqldeveloper in my case) I started SQL Developer as follows:
./sqldeveloper.sh
I then imported my connections from a previous export and was able to connect successfully. I only did a few tests in the Worksheet and browsing objects owned by my user but I didn't encounter any issues using OpenJDK 11.
I had previously encountered issues with OpenJDK 11 and OpenJFX 11 — you can read about that here:
A Tale: SQL Developer 19.2 on Ubuntu 18.04 with OpenJDK 11 and OpenJFX 11
The essence of that thread is that I had "pre-installed" the OpenJFX 11 libraries and that caused a conflict with the OpenJFX 12 libraries that SQL Developer installed automatically.
If you are still trying to pursue this I recommend ensuring you have a the JDK installed and verify as I have done in the following:
markwill#ubuntu18-vm01:~$ which javac
/usr/bin/javac
markwill#ubuntu18-vm01:~$ javac -version
javac 11.0.4
If someone is still struggling with openJDK. It won't work.
For some reason it just doesn't work with openjdk (despite it used to) but it does with JDK.
Just go here, download the *.rpm file and install it extracting with $sudo alien --scripts and $gdebi ./[Extracted_file].
Just provide sqldeveloper the /usr/java/jdk1.8.0_181 path.
Thanks for the comments, I was going mad...

Jenkins on Windows returns unsupported JVM error when Java is updated to OpenJDK 11

I have been testing updating Oracle Java 8 to Red Hat OpenJDK Java 11 on a Windows Jenkins server, but I seem to have hit a wall. My Jenkins instance is stating that Java 11 is unsupported, returning the following error after I updated the JENKINS_HOME JRE files:
"We detected that your JVM is not supported by Jenkins. This is due to the limitation is one of the libraries that Jenkins uses, namely XStream. See this FAQ for more details."
Steps I've taken:
1. Stopped and disabled Jenkins service
2. Uninstalled Oracle Java 8 191 from control panel and removed remaining program files at Java\jdk1.8.0_191
3. Installed Red Hat OpenJDK 11.0.4 msi to Java\jdk11.0.4
4. Updated JAVA_HOME and PATH variables to point to new Java locations
5. Created JRE 11 from the JDK 11 files using all modules in JDK. Specifically I utilized this site for assistance creating the JRE. Placed JRE files on the server in the standard location, Java\jre11.0.4
5. Set Jenkins service to automatic and started it. Confirmed Jenkins site was working properly, then stopped and disabled service again
6. After backing up JENKINS_HOME, replaced the JRE folder there with the jre11.0.4 folder I created from the JDK 11 files.
7. Started Jenkins service. After navigating to the Jenkins site, I received the error message about the JVM being unsupported.
8. Stopped/disabled the Jenkins service, then updated the Jenkins.war to Jenkins 2.194 weekly release. (I was previously running Jenkins LTS 2.176.3.) Started Jenkins service, only to receive the same error.
I'm not sure how to proceed, the "Upgrading Jenkins Java version from 8 to 11" Jenkins documentation isn't much help at this point. The last step in the Upgrading Jenkins section says to "Use a package manager to install the new JVM" and to "Make sure the default JVM is the newly installed version. If it is not, use the correct java command in the Jenkins startup scripts". These instructions appear to be specific to Jenkins instances running on Linux OS. If they are for all OS types, I am unsure how to follow them in a Windows environment.
I've also reviewed Jenkins' documentation for Running Jenkins on Java 11, but didn't find any useful information there either.
And finally the FAQ hyperlink in the error message does not work, and the only information provided by this similarly named XStream site is a note stating XStream requires Java 8, which is in direct conflict with Jenkins' Java documentation that says Jenkins supports Java 8 and 11.
Any suggestions for getting any version of Jenkins to run with OpenJDK 11 or what my next steps should be here would be greatly appreciated.
Software and versions:
- Windows Server 2016
- Jenkins LTS 2.176.3
- Jenkins weekly release 2.194
- Oracle Java JDK and JRE 1.8.0.191
- Red Hat OpenJDK 1.11.0.4 and JRE created from all modules in the JDK files
So it seems I missed the following instructions in the Jenkins.xml file:
If you'd like to run Jenkins with a specific version of Java, specify
a full path to java.exe.
Another member of my team saw this and added a JAVA11_HOME environment to the Jenkins.xml file:
<env name="JAVA11_HOME" value="D:\Java\jdk11.0.4"/>
And then updated the executable path in the Jenkins.xml:
From the default:
<executable>%BASE%\jre\bin\java</executable>
To:
<executable>%JAVA11_HOME%\bin\java</executable>
Jenkins is finally up and running on Java 11!

Categories

Resources