how to delete java completely from windows - java

I have messed up my windows java installation and i want to delete everything and re-install java , all of my java versions have been messed up and I don't know what to do in this situation
when I do:
C:\Users\LENOVO>echo %JAVA_HOME%
C:\Program Files\Java\jdk-17.0.1
C:\Users\LENOVO>javac -version
javac 17.0.1
C:\Users\LENOVO>java -version
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) Client VM (build 25.311-b11, mixed mode, sharing)
Why is java -version showing different things?
I HAVE TRIED CHANGING PATH AND THERE IS NOTHING IN MY PATH RELATED TO JAVA 1.8.0.
I TRIED MANUALLY DELETING JAVA BUT IT ALWAYS SAID IT IS OPEN SOMEWHERE ELSE AND CLOSE THAT BEFORE MAKING ANY CHANGES HERE

first of all you must go environment variables and then delete all Java related paths and after that follow those links and delete them also from your local computer. It's done :)

I'm not sure how to fix the issue regarding it being open elsewhere but I'd recommend trying to open task manager to close Java that way.
As for uninstalling it, you can uninstall it as it is an app. Just open settings, go to apps, search Java, and uninstall it like so.

Related

Unable to find JAVA icon in System-Preference or Library of my MAC

I have been a Windows user all my life and have recently got a MAC. My Mac is using MacOS Catalina.
I am trying to set-up JDK and get going on a project, however the issue is after I have installed JDK 11.0.4, I don't see any Java-icon on my system preference nor could I find Java folder in my ~library. However, when I go to terminal and do java -version I do see java being present as below
~ % java -version
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
I need help to see how I can resolved this, and then add my java installed location to my .bash_profile
Normally the JDK is located under
/Library/Java/JavaVirtualMachines.
The AdaptOpenJdk for example is located here: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk
For those of you that are still struggling with it. Here is the thing.
The Java Preferences app was part of Apple Java installation and is not used by Oracle Java. Therefore, OS X releases from Apple that do not include Apple Java will not include Java Preferences.
"What happened to the Java Preferences app in Application -> Utilities?"
Now, after hunting around for a while I have figured the following out:
You won't get JAVA in your Mac's System Preference until you have added JAVA home directory in your bash profile, irrespective of the java version installed
Generally be default Java gets installed in your MacintoshHD
So, open your MacintoshHD & then go to GO option from your Finder
Next click on Go to folder option and type-in ~/Library
Now you will see a Java folder and under that JavaVirtualMachines
You will now have JDK folder of whichever java version installed
Right click on JDK folder and click on info, copy the 'Where' location
Open your bash profile with following command vi .bash_profile
Once in VI editor, insert the following:
export JAVA_HOME=copied Where location from JDK folder followed by /Contents/Home
It should look something like below
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.6.jdk/Contents/Home
Now quit editor by :wq and restart your machine and you will now have JAVA in your system preference.
Hope this helps!!

My Java Runtime Environment isn't updating

I tried updating to the latest version of JRE and I checked my Java Control Panel and it says I have the latest version. But when I go on my terminal and checked by typing
java -version
I'm getting
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
However, when I checked the version by typing
/Library/Internet\
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
I did get the correct version:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
What can I do to make sure I am running version 1.8? I need it to run elasticsearch and I've been pulling my hair out over the right version of java on my machine (Mac).
you can try to run this code
System.out.println(System.getProperty("java.version"));
Go to Control Panel\All Control Panel Items\System.
Click on Advance System Settings
Under Advance Tab, click on "Environmental Variables"
Under System Variable section check "path".
check under path what is set for java.
Check your environment variable path, it would be pointing to the earlier version
Update that path and again check. It should work
It looks like I need to download the entire Java Development Kit

Cannot set up SDK for IntelliJ Idea

I am beginner in linux (running Linux Mint 18.3), and trying to set-up my environment for Java development. I've done this several times on my Windows machine, and it always worked, but couldn't make it work for linux.
Running command java-version returns the following:
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
Still, when I open IntelliJ, it says that Project SDK is not defined. When I am trying to set it up to the folder /usr/lib/jvm/java-8-openjdk-amd64/jre/bin (being the location I found digging into my filesystem starting with command whereis java) it says that "The selected directory is not a valid home for JDK". I've added manually the path also to $JAVA_HOME and '$PATH' but the problem persists.
The path you posted says "jre" in it, you need the JDK.
You need shoose JDK path
without BIN folder, like D:\java\jdk\jdk1.8.0_162

Different java versions on mac machine?

There is something going wrong with my java configuration and it is really bugging me. I am using IntelliJ IDEA and after downloading and installing java 8 I tried to configure my project to use that SDK but I could only locate version 1.6 under /Library/Java/JavaVirtualMachines/. I am new to OS X and I am really confused with the paths.
Looking on my Java control panel I can see I got installed Java 8 but after running java -version on the terminal I get 1.6.0_65.
And the which java gives back /usr/bin/java.
Please help I am completely lost
Here is an example with several Java versions installed side-by-side ...
ls /Library/Java/JavaVirtualMachines/
jdk1.7.0_25.jdk jdk1.7.0_72.jdk jdk1.8.0_05.jdk jdk1.8.0_25.jdk
User can edit ~/.profile to point explicitly at one
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
And here is result ...
java -version
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
Well something was wrong with the installation. I completely removed the other versions (not 1.6) and reinstalled 1.8 using the default path (as there is no option to change it during installation. Now IntelliJ can see JDK 1.8
Thanks for the help anyway

Eclipse in OS X uses different version of Java than CLI

When I type java -version in the console I get java version "1.8.0_05". The soft link /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK points to /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents. In the java preferences window, the only listed version of Java is 1.8. JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home.
However, when I try to run Eclipse.app, I get the error: Version 1.6.0_65 of the JVM is not suitable for this product. Version: 1.7 or greater required.
I believe it is trying to use /System/Library/Java/JavaVirtualMachines and in that directory the only version is 1.6.0.jdk.
How can I get eclipse to use the correct version of Java?
I solved this issue in my mac with yosemite:
Installed JDK for MACOSX 64bits from https://jdk8.java.net/download.html
Inside the eclipse.ini I put this line:
-vm /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
And it worked for me!
Download the 64-bit version of Eclipse instead of the 32-bit version.
The reason is that Eclipse contains native machine code (for the GUI) which is why there is both a 32-bit and 64-bit version of Eclipse, and this explicitly require the corresponding Java version. Originally Apple created both versions up to Java 6, but Oracle only creates a 64-bit version (much to the dismay of owners of older machines). So, if you download a 32-bit version of Eclipse it will only run with an Apple JVM, which apparently is too old (which surprise me - I thought Java 6 was still supported for Eclipse 4.4)
I faced this same problem but rather than making it to use version 1.8 I changed the settings in eclipse.ini file so I can just run the program regardless which version of jvm does it want to use
Solution:
Open the directory where you have Eclipse copy in your computer.
You would see a file name eclipse press control key and click on it to see the options.
Then click on Show Originalfrom the options, there you would find eclipse.ini file open it with a text editor and change the -Dosgi.requiredJavaVersion=1.7 to -Dosgi.requiredJavaVersion=1.6
Save the file and open the ecplise.app it should open now without any error
Try adding the following lines to your eclipse.ini:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
Maybe a newer version of eclipse could help, too (if yours is out of date).
Take a look in your System Preferences -> Java. It should open the Java Control Panel. In the panel, check if you have one (or many) JDKs.
I suspect you have many and are setting the JDK in your .profile while Eclipse is reading some other Java Home.
You can change them manually by running this in your terminal
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
To check if it worked, run java -version and you should see something like
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
Try calling Eclipse now from the command line. To call Eclipse as an App, just set the Java8 through the Java Control Panel. This will be read when Eclipse starts.
This is what I have on my Java Control Panel:
This is on my Eclipse Luna:
Download the 64-bit version of Eclipse.
This solved the problem. Thanks everyone.

Categories