Did you deploy your project for eclipse?
Project > Deploy for Eclipse (Or hitting F6)
I have reinstalled everything related to java on my computer and now it works...
This probably means that you have not developed your Java functionality correctly. Usually, if you have a library (.jar) with functionality, you access this through a Java action written in a .java file. Mendix generates these .java files if you create a Java action in Studio Pro.
The .java file contains glue code, which connects the Mendix API (exposed in e.g. the Core class) to the library code (in the .jar file). The .jar file should probably not contain Mendix API calls: all the app store content I am familiar with uses .java files and never .jar files which contain Mendix API calls. Even modules with lots of Java code, such as the SAML module, or the Kafka connector, which do use .jar files, write all their custom code in multiple .java files.