After switching between Java 8 and 11 versions, an error occurs in confirmation

Premise

I will post Qiita for the first time. Thank you. I set the path to switch the current Java version to 11.8.

problem

version confirmation

error

--version


Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Solution

When I googled, it came out that the command was wrong. Eh ... 11 I was able to confirm this, but ... and this time

Run with. Then

openjdk version "1.8.0_252"


```Was displayed.

 When I changed the path in reverse (8 → 11) and performed java -version, this was also displayed normally.
 I decided to remember it with java -version. I don't know the cause ... (beginner)


Recommended Posts

After switching between Java 8 and 11 versions, an error occurs in confirmation
When using a list in Java, java.awt.List comes out and an error occurs
Difference between final and Immutable in Java
Difference between int and Integer in Java
What to do and how to install when an error occurs in DXRuby 1.4.7
Difference between next () and nextLine () in Java Scanner
Distinguish between positive and negative numbers in Java
Summary when trying to use Solr in Java and getting an error (Solr 6.x)
Differences between Ruby syntax error statements in Ruby and binary
[Java] Difference between static final and final in member variables
What happened in "Java 8 to Java 11" and how to build an environment
An error occurs when codedeploy-agent is installed in Ubuntu Server 20.04
Think about the differences between functions and methods (in Java)
Get attributes and values from an XML file in Java
Differences in how to handle strings between Java and Perl
Generate AWS Signature V4 in Java and request an API
[Java] Difference between Stack Overflow Error and Out Of Memory Error
Remove consecutive line breaks and tabs before and after in Java
Is short-circuit evaluation really fast? Difference between && and & in Java
Avoid Yubaba's error in Java
[Java] Difference between == and equals
Note No. 1 "Counting and displaying duplicate values in an array" [Java]
Collecting client information when an error occurs in a web application
Resolved the error that occurred when trying to use Spark in an environment where Java 8 and Java 11 coexist.
I sent an email in Java
Differences between "beginner" Java and Kotlin
[Java] Difference between Hashmap and HashTable
Encoding and Decoding example in Java
Try an If expression in Java
StringBuffer and StringBuilder Class in Java
[JAVA] Difference between abstract and interface
[Java] Relationship between H2DB and JDBC
[Java] Difference between array and ArrayList
Understanding equals and hashCode in Java
I made an annotation in Java.
Differences between Java and .NET Framework
[Java] Difference between Closeable and AutoCloseable
[Java] Difference between StringBuffer and StringBuilder
[Java] Difference between length, length () and size ()
Hello world in Java and Gradle
Run an external process in Java
A note on the differences between interfaces and abstract classes in Java
Understand the difference between int and Integer and BigInteger in java and float and double