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.