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.

faraz@faraz-HP-ProBook-640-G1:~$ 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.

  • fyi: Lubuntu 16.04 LTS is EOL as it was a flavor having only 3 years of supported life. Ubuntu 16.04 LTS (with Unity 7 desktop, server [no desktop] or Kylin) came with 5 years of supported life, all other flavors had only 3 years of supported life. – guiverc Aug 14 at 2:38
  • guiverc, I love you more than Shane Warne loves John Buchanan. But what on earth what you said has to do with my question? – Faraz Durrani Aug 14 at 2:43
  • @guiverc but thank you anyway – Faraz Durrani Aug 14 at 2:43
  • You've tagged lubuntu, and I'm the lubuntu team member tasked with askubuntu. If you'd tagged only 16.04 or ubuntu, I'd have said nothing. – guiverc Aug 14 at 2:44
  • @guiverc I was only kidding bro. I love you. – Faraz Durrani Aug 14 at 2:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.