Compilation of java actions failed

3
Hi Everybody,   I am receiving the following error while running the application locally. Buildfile: C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\build_core.xml compile:     [javac] Compiling 1 source file to C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\run\bin     [javac] C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\javasource\system\UserActionsRegistrar.java:10: error: cannot access ActivateProductLicenseJava     [javac]     registrator.registerUserAction(approntolicenser.actions.ActivateProductLicenseJava.class);     [javac]                                                            ^     [javac]   bad class file: C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\run\bin\approntolicenser\actions\ActivateProductLicenseJava.class     [javac]     class file has wrong version 59.0, should be 55.0     [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.     [javac] C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\javasource\system\UserActionsRegistrar.java:11: error: cannot access GetApplicationUrl     [javac]     registrator.registerUserAction(approntolicenser.actions.GetApplicationUrl.class);     [javac]                                                            ^     [javac]   bad class file: C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\run\bin\approntolicenser\actions\GetApplicationUrl.class     [javac]     class file has wrong version 59.0, should be 55.0     [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.     [javac] C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\javasource\system\UserActionsRegistrar.java:12: error: cannot access BackupCreate     [javac]     registrator.registerUserAction(approntospotlightsearch.actions.BackupCreate.class);     [javac]                                                                   ^     [javac]   bad class file: C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\run\bin\approntospotlightsearch\actions\BackupCreate.class     [javac]     class file has wrong version 59.0, should be 55.0     [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.     [javac] C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\javasource\system\UserActionsRegistrar.java:13: error: cannot access BackupRestore     [javac]     registrator.registerUserAction(approntospotlightsearch.actions.BackupRestore.class);     [javac]                                                                   ^     [javac]   bad class file: C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\run\bin\approntospotlightsearch\actions\BackupRestore.class     [javac]     class file has wrong version 59.0, should be 55.0     [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.     [javac] C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\javasource\system\UserActionsRegistrar.java:14: error: cannot access CreateIndex     [javac]     registrator.registerUserAction(approntospotlightsearch.actions.CreateIndex.class);     [javac]                                                                   ^     [javac]   bad class file: C:\UserData\z0045cks\Documents\Mendix\SPRINT-dev\deployment\run\bin\approntospotlightsearch\actions\CreateIndex.class     [javac]     class file has wrong version 59.0, should be 55.0     [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.   Any idea why this occurs? Thanks! :)
asked
7 answers
13

This normally occurs if you open the Java Actions in an IDE like Eclipse that can auto compile them. You need to turn off this functionality and let Mendix do the compiling when you build your application.

answered
3

Hi Ritika,

Clean the deployment directory and re run the application once.

 

answered
1

Hotfix : App  – > clean deployment directory   and then Run the app again  again 

the error Because you are accessing the app from eclipse  

answered
0

Hi, 

I see the following error in the stack trace: [javac]     class file has wrong version 59.0, should be 55.0

This is coming from approntospotlightsearch and approntolicenser

Obviously means, your java version is behind than the version used to compile that module.

Try to upgrade your java version

answered
0

How do we upgrade the java version @Nirmalkumar

answered
0

For any Mendixers have encountered this problem: here is how you can fix your project:
 

If you haven't committed yet:

-delete the JavaActions folder + update. Then compile and everything should work.

If you have committed:

-create a branch of the last version that still had the proper java files. Copy the JavaActions folder and paste in your project-to-fix. Compile. That should fix the problem.

 

Maybe someone here could explain how to fix the the class problem in Visual Studio Code in steps: I have tried, but haven't succeeded. I managed to turn off autocompile in VSCode, but I haven't been able to revert to an older java version, then do a recompile. 

answered
0

If you are a MacBook user, and running parallels then do not directly open the project from documents folder. Go to the actual path on your machine where Mendix folder exists and then open your project from there and try to run.

For example: Y:\Documents\Mendix\[PROJECT NAME]

answered