Are you using Java 11? This is the version that Mendix uses. I would suggest cleaning your deployment directory in Studio Pro and disabling automatic compilation in Eclipse. This means Mendix will compile the Java modules itself when you build your application in Studio Pro.
Hope this helps.
You Can check the JDK Utilized by your modeler under Edit – Preferences and Use the relevant JRE in Eclipse