Intelli J Idea has made my project into gibberish!
已回答
Desktop project, fully local, no GitHub etc involved. Source files are on a NAS box. This has worked without trouble for months. Today, ALL my source files are marked as located outside the source root (I've NOT changed or moved ANYTHING). Most of the modules have had their language level set to 5 (yes, 5); when I reset them to 24 Idea carefully sets them back to 5. Modules are also marked as loaded from Maven. In Project Structure the module sources have the right directories everywhere.
Does anybody have a clue what's going on here and how to get out of this mess (NOT of my making!)?
Idea version is 2025.2 Community edition #IC-252.23892.409,
请先登录再写评论。
I've reverted to 2025.1.4.1 and the problem seems to have gone away.
Sorry. I lied. It's still messed up but not clearly flagged.
Hi Andrew Gegg
Could you please collect the log by going to Help | Collect Logs and Diagnostic Data, attaching the zip file through our safe upload site https://uploads.jetbrains.com/, and share the uploadID for further review.
Thank you for your reply. The upload id is:
Upload ID: 2025_08_20_4gQPGc3wCRw2LW3Rckjajx (file: idea-logs-20250820-1714404717187550141263785.zip)
Andy
Hi again Andrew Gegg
Could you also send for analysis:
pom.xmlfileHi Monica,
Thank you for your reply; I apologise for not replying more quickly. I have uploaded screenshots of the project tree and the top level pom file:
Upload ID: 2025_08_22_qTSEQeYrzKeu6kvf3HqkUf (files: Screenshot 2025-08-22 163334.png and 2 more)
Upload ID: 2025_08_22_AMero9MQw7hZyjBKqzRGJW (file: Screenshot (1).png) (full project window)
As background, I am on WIn 11 Pro, fully up to date. The project is a desktop application using JavaFX and modularised (as in Project Jigsaw). Module gui is the top level with the JavaFX stuff. My intention was to allow the user to choose different data suppliers so it uses the service provider mechanism. The service is defined by module spi which consists mostly of Interfaces. Module sqlimpl implements the service for a variety of RDBMSs.
Perhaps relevant is that I moved to a new PC a year ago and put all my files onto a NAS box, including the project files. Originally these were on the D: drive of the old PC; they are now mounted as a share labelled the J: drive. As far as I can remember I just pointed Idea at the J: directory and it all worked with very little trouble and has done for the last year. Now, all the files are marked in red except the ones in gui and spi.
Hi Andrew Gegg,
I reviewed the logs, and the problem may be related to the file system, whether it's that a file system watch is being attempted on a relative path (
src/test/java) when an absolute path is required and/or corrupted cache or files. Please do the following:src/main/java,src/test/java, etc.) are correctly marked as "Source Roots" or "Test Source Roots" and that their paths are resolved correctly by IntelliJ..imlfiles and the.ideafolder within your project directory..m2for Maven).If non of the above works please let me know.
Hi Monica,
Thank you for your reply and the time and effort you're taking.
But it's hopeless. I've done what you suggested and things looked as if they'd been found but it keeps forcing the language version to 5 then complaining about it. The module-info files are all marked as outside the root. When I tried to compile, Maven complained that the POMs don't exist because it can't understand a file path to a NAS box (it interprets J:\directory\directory\… as J:\NASname\directory\…) - and it certainly used to work. And it complains about unsafe modules in IntelliJ.
This all seems to be as a result of letting it update to 2025.2
Thanks again for your help,
Andy
I'm checking the issue with the team, and I'll come back with comments about it.
Looks related to https://youtrack.jetbrains.com/issue/IDEA-377865/WSL-IDEA-ignores-Mavens-Language-Level-settings .
Andrew Gegg Does IDEA currently resolve the Project's Content Roots correctly?
IDEA should set the Language Level based on Maven's configuration.
Do all of your Projects Modules / Subprojects have the Language Level explicitly set the same way their Parent Project has (via
<properties>andmaven-compiler-plugin)?As the workaround please try the following:
2025.1and2025.2versions).ideadirectory found inside your Project's directory. Make sure not to delete it.pom.xml-> Open as ProjectIf the issue persists, would it be possible to share the Project or its POMs (preserving the directories' structure) for further investigation?
Hi Monica, Serge and Roman,
Thank you for your replies and your time and support here.
I've installed 2024.3.6, wiped out the system directories, replaced the project directory with a backup, wiped out the .iml files and .idea directory and opened it as a new project from the pom as suggested by Roman.
Everything looked good, I could execute the main file and run a test file.
BUT all the module-info files have red icons. All the ‘target’ directories have red icons. The project is modular (obviously) with various layers. I can compile, package and install the lowest level module BUT the next level up fails to compile because it can't find the module I've just compiled! In 'project structure' the target directories are marked as excluded - I've no idea how to INclude them. I tried deleting all the target directories (I've nothing to lose…) and recompiled the lowest level module which succeeded and created the target directory but it's still red.
Thank you again for your time
Hi again,
Apologies to Roman - I've only just noticed the last line of your post. I'm quite happy to send you a copy of the whole project as it was when I first had the problem. A zip of it is about 16MB. Let me know what you want me to do.
Regards,
Andy
Please share a project via https://uploads.jetbrains.com and provide the ID here.
Hi,
Upload ID: 2025_09_01_PtK7w5zJ3rxYDDyhkyvvE2 (file: GardenNotebookM - Copy_20250819 _to_zip.zip)
I put my hand up to some truly embarrassing code…
As an aside, I tried creating a trivial modularised app, following the demo on the Help pages (Trisha Gee using IJ2017) and that had the module-info.java file with a red teacup icon. Mind you, it failed to understand System.out.println so something has gone horribly wrong while I've been trying to sort out the original problem!
Best regards,
Andy
Andrew Gegg Thank you for sharing the Project!
Curiously, the Project appears to import and parse successfully on my end. It also builds successfully both with Maven and IDEA. That suggests the issue is specific to your machine.
Try uninstalling all versions of IDEA from your computer, removing all of the leftover directories, installing the latest release (2025.2.1) and import the Project as described in my earlier comment:
Hi Roman,
Thank you for your reply and for spending time and effort on this.
Firstly, I'm not at all surprised that it all ran on your machine.
I've cleared everything out and downloaded and installed 2025.2.1. I pointed it at my project, as you said, and it's there and I can run it . BUT all the module-info files have a red teacup icon and are just marked as java files - is that correct? Red seems like a bad colour for a standard icon! Also, I tried to use Maven, through the IDE, to build the project. The bottom most module is fine (clean, compile, package, install) and the .jar is there. When I try to do the same thing with the next level up it fails saying the required module does not exist:
[ERROR] Failed to execute goal on project spi: Could not collect dependencies for project uk.co.gardennotebook:spi:jar:3.2.2-SNAPSHOT
[ERROR] Failed to read artifact descriptor for uk.co.gardennotebook:utils:jar:3.2.2-SNAPSHOT
[ERROR] Caused by: The following artifacts could not be resolved: uk.co.gardennotebook:GardenNotebookM:pom:3.2.2-SNAPSHOT (absent): Could not find artifact uk.co.gardennotebook:GardenNotebookM:pom:3.2.2-SNAPSHOT
When I tried just using Maven (in the IDE) on the top level module (the containing module) it gets into real trouble with garbled poms (J: is the NAS share so the real file names are J:\Users\…)
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[FATAL] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[FATAL] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[FATAL] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[FATAL] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
@
[ERROR] The build could not read 5 projects -> [Help 1]
[ERROR]
[ERROR] The project uk.co.gardennotebook:utils:3.2.2-SNAPSHOT (\\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\utils\pom.xml) has 1 error
[ERROR] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[ERROR]
[ERROR] The project uk.co.gardennotebook:spi:3.2.2-SNAPSHOT (\\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\spi\pom.xml) has 1 error
[ERROR] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[ERROR]
[ERROR] The project uk.co.gardennotebook:sqlimpl:3.2.2-SNAPSHOT (\\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\sqlimpl\pom.xml) has 1 error
[ERROR] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[ERROR]
[ERROR] The project uk.co.gardennotebook:fxbeans:3.2.2-SNAPSHOT (\\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\fxbeans\pom.xml) has 1 error
[ERROR] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[ERROR]
[ERROR] The project uk.co.gardennotebook:gui:3.2.2-SNAPSHOT (\\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\gui\pom.xml) has 1 error
[ERROR] Non-readable POM J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml: J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml (The system cannot find the path specified) @ J:\Synology224\SharedData\Users\andy\Programming\IdeaProjects\GardenNotebookM\pom.xml
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
I'll try it on a local directory tomorrow.
Oh, I set up a Ubuntu VM on my PC, installed IntelliJ 2025.2.1 and built a tiny project, top level, one module with example code then added a module-info file through the menu - and that had a red teacup icon too - so that's not something hanging about. Am I doing something really stupid? Have I missed a blindingly obvious flag for modular projects?
Best regards,
Andy
Andrew Gegg Thank you for the update!
You've brought up multiple points, let's go through them one by one:
1. For the
module-infofiles IDEA uses the following default icon:It may look different, if you have a Theme applied to your IDEA installation.
2. “
The system cannot find the path specified” error appears to come directly from Maven itself. Does it runs as intended, if you execute it directly from the OS Command Prompt?The error itself may come from Maven either misinterpreting the local / network path or from it not having the permissions to access to the file(s) / one of their parent directories. Latter may happen for instance if Maven fails to apply credentials needed to access the network share or not inheriting the credentials from IDEA.
3. For the test you've done on the Ubuntu VM, could you please elaborate?
Did the test Project built successfully? Did you encountered any issues with code highlighting or with how IDEA interprets certain files / file types?
Hi Roman,
Thank you for your reply. I apologise for taking so long to respond.
Thank you for the picture of the icon - it sets my mind at rest! (When everything suddenly went red I noticed the module-info icon for the first time and thought it, too, was showing as an error).
I've not tried executing maven from the command line - not something I have any experience of - I rely on an IDE for that sort of thing!
With local source files, IDEA builds the application OK. I've only done it by building the top level module which does the job and builds the .jar files which is all I need to plug into jpackage. I've not tried building each lower module separately as there seems little point.
As for the Ubuntu VM, well VM wrangling is all new to me and I haven't used a *nix type OS for over 30 years so it's a bit of a culture shock. However, I've got it set up, application compiles and runs with a copy of the source files in the VM - I couldn't see a way of accessing remote files from within IDEA - and it's just like using IDEA on WIndows, which is great!
Thank you again for the time you have spent on this. I have a working system again even if the original problem hasn't really been resolved, so I'm happy to leave it at that if you are.
Andy
Andrew Gegg Thank you for the update!
It looks like you might be running into an issue with Maven and mapped drives.
It was reported in IDEA-379587 and a Maven bug was created as the result.
That would explain why the Project works when it's on the local filesystem.