IntelliJ throwing an error in code that is correct
Answered
I keep getting an error with my code that I should not be. I am using the jInput library. This is my code
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
Controller myJoy = controllers[0];
Component[] components = myJoy.getComponents();
This code is correct but once I add a for loop it says it is wrong.
for(int i = 0; i < components.length; i++){
}
There is nothing wrong with my loop and it just highlights it in red.
Please sign in to leave a comment.
Hello,
The issue is not reproduced for me with IDEA 2019.1.3. Please share the screenshot of the error highlighted in Editor and clarify what JDK version, Project (Project Structure | Project Settings | Project | Project Language Level) and Module (Project Structure | Project Settings | Modules | Sources | Language level) Language Levels do you have defined for your project? Thank you