<-- Back

How to clean the userlib folder

Introduction

Conflicting JAR files in the userlib folder of an app directory can cause Java errors when running the app:

Compilation of Java actions failed

Removing duplicate JAR files from the userlib folder will resolve these errors. This article will describe how this can be accomplished.

Note: Mendix introduced Managed Dependencies in Studio Pro 10.3.0, which allows Studio Pro to automatically download dependencies and resolve conflicts by leveraging Gradle, and stores them in the vendorlib folder. Using this feature will eliminate the need to find and remove duplicate JAR files, thus it is advised to migrate to Managed Dependencies by following the Migrating from Unmanaged to Managed Dependencies, to prevent these issues from occurring in the first place.

Environment

Studio Pro (all versions)

Instructions/Procedure

Duplicate JAR files can be removed manually by checking the userlib folder of a project in the app directory (can be accessed via Studio Pro by navigating to App > Show App Directory in Explorer). Alternatively, this can be done by using the third-party Mendix Userlib Cleaner tool developed by Cinaq, as described below:

  1. Download the corresponding build from the releases folder
  2. Unzip the mendix-userlib-cleaner.exe into the userlib folder of the app directory.

    mceclip1.png
  3. In the Explorer window, click on the path, type cmd and press enter.

    mceclip2.png
  4. This opens a black terminal window. In this terminal window, use the following command: .\mendix-userlib-cleaner.exe.
    The output will inform you what it will remove.

    mceclip4.png
  5. Verify the output. Thereafter, to actually remove the JAR files, use the following command:
    .\mendix-userlib-cleaner.exe --clean

    mceclip3.png

Note that this tool will only check for libraries. If there is anything else in the folder that is not a JAR file or a .Required extension, then it should not be in the userlib folder and can be deleted.

It is also recommended to clean the deployment directory of the app after performing the above steps before attempting to run the app again. This can be done by navigating to App > Clean Deployment Directory in Studio Pro.

Outcome

The userlib folder will be cleaned and will no longer contain conflicting JAR files.

Internal information related

  • 256293, 251126, 195623, 240133, 201110, 253589

Additional information

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.