Set java path in Lubuntu 16.04

by Faraz Durrani   Last Updated August 14, 2019 02:02 AM

I downloaded a tar file and I am untar'ed it and stored it at this location:

/home/faraz/Desktop/IF/zulu8.38.0.13-ca-jdk8.0.212-linux_x64

I want to run java myjavaclass but I can't. I tried to set it in /etc/environment but that didn't work. I also tried other ways but that file it self doesn't exists.

Can somebody please tell me how to do it?

edit: I didn't install java thru terminal by running a command similar to sudo apt-get install someversionofjava. I only downloaded tar file. In Eclipse, I can set Java path easily and all Java programs runs flawlessly inside Eclipse. But if I want to run a java file or jar file thru terminal, that's where I am facing the issues.

[email protected]:~$ java 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 install

I don't want to install java that way. No.

Tags : lubuntu java


Related Questions


Updated February 18, 2016 07:01 AM

Updated February 12, 2018 16:02 PM

Updated April 19, 2019 17:02 PM

Updated November 14, 2017 15:02 PM

Updated August 21, 2018 17:02 PM