WSL2: Reloading Maven on IntelliJ -> NoClassDefFoundError on FileSystems$DefaultFileSystemHolder and HttpWagon

Viewed 1068

Opened issue on YouTrack here but no response for almost a month.

I have a multi module ear project where the java backend portion is not being recognized as inside the project root. This is because of maven not having access to a target folder to create an application.xml. Here's a copy of the IntelliJ log.

It seems to hit a NoClassDefFoundError on DefaultFileSystemHolder and HttpWagon. I can still build my project fine because I set npm, jdk, maven, maven importer, etc paths inside wsl2 instead of on C:/... But in the Maven tool window all the project modules are red underlined and the plugins are not shown. When hovering here it gives one of either noclassdeffounderrors, not always the same (httpwagon or defaultfilesystemholder).

My TS/React module seems fine with code completion etc, but the java backend and api modules are not being recognized at all. When hovering over one of the file icons with the red J it says "Java file outside of source root".

Please, if there's any other information/logs/anything I can provide please let me know.

IntelliJ IDEA 2021.1 (Ultimate Edition)
Build #IU-211.6693.111, built on April 6, 2021
Runtime version: 11.0.10+9-b1341.35 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2028M
Cores: 8
Non-Bundled Plugins: manjaro.mpb (1.5), izhangzhihao.rainbow.brackets (6.17)
Kotlin: 211-1.4.32-release-IJ6693.72
2 Answers

Had the same problem. Resolved it by updating to maven 3.8.1

I solved the problem by installing adopt-openjdk version 11 in Ubuntu (I only had version 8). I then changed the maven importer setting to use this jdk.

Related