I am a beginner to Java as well as to Ubuntu.
I downloaded JDK 10.0.2 zip file and unzipped using tar command.
I used vim .bashrc and typed the following
export JAVA_HOME=path of my Java
export PATH=$JAVA_HOME/bin:$PATH
source .bashrc
echo $JAVA_HOME
and echo $PATH
giving the correct path of my Java 10.0.2
I am able to compile the file using the javac command and .class file created successfully.
When I am running java ( java ./Desktop/app/Numbers) referring to the class file, I am not able to run and getting the "Main class not found exception"
But, when I go to that particular folder and execute the javac as well as java, I am getting the output.
What I have tried
1) vim .bashrc
and typed the above. But it didn't work.
2) sudo vim ./etc/environment
and tried adding within the quotes :/javapath/bin"
. It didn't work.
Guide me where I am going wrong.
~/Desktop/app/Numbers
instead! You seem to have adot
before that path