Hi, I’m struggling to compiile my java source code and run it from the terminal… (Yeah I’m new to OpenSUSE/linux in general)
I’ve made a simple program which I then try to compile using “javac Welcome.java” and I get…
green@linux-v85t:~> cd Desktop
green@linux-v85t:~/Desktop> cd Java
green@linux-v85t:~/Desktop/Java> ls
test.java Welcome.java
green@linux-v85t:~/Desktop/Java> javac Welcome.java
If ‘javac’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf javac
green@linux-v85t:~/Desktop/Java>
Now on Windows I remember I had to do something with the environment variables but I have no idea how to do that here.
java -version gives me…
java version “1.7.0_15”
OpenJDK Runtime Environment (IcedTea7 2.3.7) (suse-8.3.1-i386)
OpenJDK Server VM (build 23.7-b01, mixed mode)
Any help is much appreciated.
Thanks
Also, how would I go about updating my java version?
Post output of the below command(you can select and copy output from terminal using ctrl+shift+c and paste here using ctrl+v) within code tags(use # button in post editor)
zypper lr -d
After reading the below stuff you should do this Post#2
On 2013-07-05 18:16, thegreenmarine wrote:
>
> Hi, I’m struggling to compiile my java source code and run it from the
> terminal… (Yeah I’m new to OpenSUSE/linux in general)
>
> I’ve made a simple program which I then try to compile using “javac
> Welcome.java” and I get…
Trick.
For posting code in the forums, you have to paste it inside a…, guess,
CODE block
It is the ‘#’ button in the advanced editor.
> green@linux-v85t:~> cd Desktop
> green@linux-v85t:~/Desktop> cd Java
> green@linux-v85t:~/Desktop/Java> ls
> test.java Welcome.java
> green@linux-v85t:~/Desktop/Java> javac Welcome.java
> If 'javac' is not a typo you can use command-not-found to lookup the
> package that contains it, like this:
> cnf javac
> green@linux-v85t:~/Desktop/Java>
Now on Windows I remember I had to do something with the environment
variables but I have no idea how to do that here.
The text above is telling you what is the problem and what to do. javac
is not found, and the usual reason is because you typed it wrong, and if
it is correctly typed then because it is not installed. And it proposes
you type “cnf javac” to find out if you can install it.
Why did you not try?
cer@Telcontar:~> cnf javac
javac: command not found
cer@Telcontar:~>
Well, in this case it is not very helpful :-}
But you have already been told what you need.
> Also, how would I go about updating my java version?
Just by running “yast online update” should do it.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)