I am using WSL-2 Ubuntu 20.04 on windows10 and I want to run a java application on it but I get the following error:
Error: JavaFX runtime components are missing, and are required to run
this application
It is strange because I have installed Java 8 which has JavaFX included.
java -version gives me back the following:
java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
javac -version
javac 1.8.0_312
I am running the java program in the following way:
java -jar myprogram.jar
What do I miss?
Related
I'm trying to install JDK8 as a platform on NetBeans 12.2, but I keep getting this error message:
"Cannot detect and install the selected platform. The java or javac may not be executable."
Is there a way around this? Or is there a version of JDK8 that won't yield this error message?
Further: I should have mentioned that I'm on MACOS Big Sur.
Here's what I get with java -version in Terminal:
java version "15.0.2" 2021-01-19 Java(TM) SE Runtime Environment (build 15.0.2+7-27) Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
And here's what I get with javac -version:
javac 15.0.2
You are probably getting this message because the JDK executables haven't been added to your path as environment variables. Directly from the official java website, here's a guide on how to fix this problem.
solr version is 6.0.0
When I run
>bin/solr -e example
error with
Java not found, or an error was encountered when running java.
A working Java 8 is required to run Solr!
Please install Java 8 or fix JAVA_HOME before running this script.
Command that we tried: 'java -version'
Active Path:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
my java version is
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
and my PATH is
/opt/java/bin:/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I edit the bin/solr
116 JAVA=java
to
116 JAVA=/opt/java/bin/java
then it works!
Ran into a similar issue on 5.5, this link helped me: https://www.garysieling.com/blog/install-solr-ubuntu
I created a new project using Clojure by doing this on a Mac:
lein new app clojure-noob
Created my uberjar using
lein uberjar
Sure enough, I can run this uberjar via:
java -jar target/uberjar/clojure-noob-0.1.0-SNAPSHOT-standalone.jar
And I get:
Hello, World!
Now I take this file to Windows 7 and give the same command:
java -jar clojure-noob-0.1.0-SNAPSHOT-standalone.jar
I seem to get an infinite wait. Why can’t I get to runt his .jar file on Windows?
The java version on Mac is:
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
The java version on Windows 7 is:
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) Client VM (build 25.66-b18, mixed mode)
lein version gives the following: Leiningen 2.5.3 on Java 1.8.0_51 Java HotSpot(TM) 64-Bit Server VM
The answer is that I was trying to run the .jar from shared folders on a Windows 7 VM from VirtualBox running on a Mac. This IO is very slow.
When I just copy that file to, say, Desktop and run from there - the access is quiet fast. Thanks SubOptimal for helping me figure this out.
I have downloaded Java on mac mavericks system. But when I type on terminal to see the Java version using command:
java version
I get the following error
Could not find or load main class version
I went to oracle website and tried a check to see if Java is installed on my system,which confirmed the Java7 is installed on the system. But why can I not see version in terminal?
Try
java -version
Without the minus sign it is trying to load a program called version.
java –version
will cause the same error (copied from webpage) as "–" is an em dash
java -version is the command to check java version
Download latest Java SE from Oracle site and install it. Then reopen cmd and check java version using java -version.
Set the Java path to bin and check it's version also. Both java and javac should be on same version.
In my case:
C:\Users\darshan>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
C:\Users\darshan>javac -version
javac 1.8.0_121
Eclipse returns this error message when launching:
I am pretty sure that both the java installation and Eclipse are both for my 64-bit system.
Here is my .ini file:
Your version of Eclipse looks OK, based on the filename.
To check your version of Java, run java -version in a console. On Windows 7 with 64-bit Java 6 I get:
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
Check that this is the version being used by Eclipse, as shown in your error code. If not, call that version explicitly, e.g.
"C:\Program Files (x86)\Java\jre7\bin\java.exe" -version
I moved the
-vm
up below the first openfile, not the second.
PIC: