This will compile:
class Myclass {
int x;
Myclass (int x) {
}
}
However, when you do this you end up with two variables with the same name, the instance variable x, which can be referred to explicitly inside the constructor (or any other class method) as this.x, and the local parameter variable x local to the constructor. If you just refer to x in the constructor you'll get the local one. This is referred to as variable shadowing.
Even though you've decided to give these two variables the same names in your source code, in the code the compiler produces they are completely unrelated. You might as well have named the parameter y.
An experiment to try that might help understanding this is to give the variables different types. Make your instance variable a boolean, for instance. Then you can try different things and see that they really are completely different variables that just happen to have the same name.
JAVA_HOMEenvironment variable to your installation directory? Did you add%JAVA_HOME%\binto yourPATH(or$JAVA_HOME/bin, if you use OSX or Linux)?