It's not a problem. However, it is generally accepted good design practice to limit the scope of every variable so that it's as wide as it needs to be - but no wider ;-)
This means that:
- you don't use a method local variable as the controlled variable of a for loop, if you can declare the controlled variable in the for loop heading.
- you don't use a class global variable (field) inside a method if you can instead use a local variable declared inside the method.
- you don't declare a field public if it can be protected, nor protected if it can be private.
- you don't declare a field static if it can be non-static.
- class level "final" values should be declared static.
In my experience as a Java programming teacher, most students have difficulties with the second option, and will tend to declare a lot of class global fields for variables should have been declared local.