-7

I have a new system Linux Ubuntu 16.04. I have downloaded(only downloaded not installed) Java 9 and in the downloads folder there are two folders related to Java 9 (jdk-9.0.4) and (jdk-9.0.4_linux-x64_bin.tar.gz).

Now I want to keep Java 8 and remove from downloads all the things related to Java 9. But when in terminal I write javac -version it gives me

openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

How to remove everything related to Java 9 from the downloads folder? How to enable and run the Java 8 which is showing present Why there are no folders related to Java 8 in the computer

Ashu
  • 2,066
  • 3
  • 19
  • 33
  • 1
    What is the problem? You want Java 8 and that's what you are getting. try `which javac` – Peter Lawrey Aug 01 '18 at 18:08
  • Possible duplicate of [Where is the Java SDK folder in my computer? Ubuntu 12.04](https://stackoverflow.com/q/16931327/5221149) – Andreas Aug 01 '18 at 18:10
  • Want to remove everything about Java 9. Yes I am able to see Java 8 but how to run it. Also which javac returning nothing but just xyzpc:~$ – Shirshendu De Aug 01 '18 at 18:12
  • 1
    *"How to remove everything related to Java 9 from the downloads folder?"* How did you download without installing? Do the reverse operation. --- *"How to enable and run the Java 8 which is showing present"* It's already enabled and you just ran it. --- *"Why there are no folders related to Java 8 in the computer"* They are not where you're looking. Look elsewhere, e.g. see [Where is the Java SDK folder in my computer? Ubuntu 12.04](https://stackoverflow.com/q/16931327/5221149) – Andreas Aug 01 '18 at 18:12
  • check this: [How can I have multiple versions of the Java JDK installed on my machine at the same time?](https://stackoverflow.com/questions/39111269/how-can-i-have-multiple-versions-of-the-java-jdk-installed-on-my-machine-at-the) – Sahil Aug 01 '18 at 18:14
  • you can use any version using "update-alternatives --config java" command. so do not worry if you have java 9 installed. make sure you have java 8 and then use the command. – Sahil Aug 01 '18 at 18:16

1 Answers1

0

You can't run javac since the system only has a JRE, not a Java SE (JDK). This means, you can run Java programs but not compile new ones (so far).

You need to install a separate Java to be able to compile. You can have multiple JVMs. I have Java 6, Java 7, and Java 8 installed. In Eclipse I choose which one to use separate per project.

The Impaler
  • 45,731
  • 9
  • 39
  • 76