Set java path in Lubuntu 16.04

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

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


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

Oracle Java not found

Updated February 18, 2016 07:01 AM

Installing Java for Lubuntu

Updated February 12, 2018 16:02 PM

How to install Java 8 on Ubuntu 19.04

Updated April 19, 2019 17:02 PM

Installation error oracle-java8-installer

Updated November 14, 2017 15:02 PM

Can't open logisim in Lubuntu

Updated August 21, 2018 17:02 PM