You stated that you are using Mendix version 8.5, the JDK requirement is JDK 11 see https://docs.mendix.com/refguide/system-requirements.
If you are changing java code in Eclipse for example make sure the compilation version in Eclipse is the same as the jdk being used by Studio Pro (under preferences)
This might solve your compilation error. If not please edit your question to inform the forum on the exact module you are using and maybe copy and paste the line of code that is giving you compilation issues.