Vamsi Shankar
Vamsi Shankar

Reputation: 143

Getting this after uninstalling java

Getting this after uninstalling java

java -version
bash: /usr/bin/java: No such file or directory

And when I check for javac I get this

javac -version
bash: /usr/bin/javac: No such file or directory

Instead I expect this

The program 'java' can be found in the following packages:
 * default-jre
 * gcj-5-jre-headless
 * openjdk-8-jre-headless
 * gcj-4.8-jre-headless
 * gcj-4.9-jre-headless
 * openjdk-9-jre-headless
Try: sudo apt-get install <select package>

To output Please help me.

Upvotes: 1

Views: 499

Answers (1)

CodeTalker
CodeTalker

Reputation: 1791

Bash had an alias set as java and alias was set to usr/bin/java. When you have any alias set, bash expands the alias and executes it. Here your alias usr/bin/java did not exist as you uninstalled java hence it says No such file or directory. Remove the alias or restart shell and you will get the desired message. Same applies to javac.

Read more about alias here.

Upvotes: 1

Related Questions