Obviously there will be an error. When you remove "static" x2 becomes an instance variable (can be accessed only with object) and you cannot access it with class name.
It has nothing to do with "protected" access modifier.
I am the one who knows that I don't know anything.
Ok, you have 2 ways how to access x2 here; either keep static keyword and you can access it directly because you have copy of x2 inherited in your testpack class anyways. Or you can remove the static keyword then use an instance of testpack class to access the inherited copy of x2, check below for sample:
You can also use some getter method if you want but I don't think this is the main question here.