JavaFX 11 Issue


Error:(1,1) java: module Reports reads package java.awt from both java.desktop and java.datatransfer

I'm clueless to this problem and how to fix it. is as follows:

module Reports {
requires com.jfoenix;
requires javafx.fxml;
requires javafx.controls;
requires java.sql;
requires org.joda.time;
requires jna;
requires jna.platform;
requires java.datatransfer;
requires java.desktop;


Is it possible to share sample project for investigation? It works fine on my machine with IDEA 2018.3 EAP and JDK 9.


I have a metoo on this one. Is there a solution?


We need a sample project to understand why you have this problem.


FYI this issue happens because intellij automagically makes an entry, (maybe somewhere else in the project files),  which appears in build, execution deployment-->java compiler-->override compiler parameters per module section of settings. 


In the table there there will be an entry for  the effected module name and on the right half of the table in the "compilation optrions" column  there is an entry giving compiler parameters. On the effected module this appears:

add-exports java.datatransfer/java.awt=YOUR_MODULE_NAME


Since I  never wrote it, I know Intellij did. I don't know why. Since it was the only module with any entry under the column compilation options, it was suspicious. When I deleted it the problem went away. 


The error message during compilation only ever refers to the file; it's misleading because there's nothing wrong with the file. I confirmed  this by transfering the module into a new project and watching it compile without a problem. Also, more evidence there was nevver anything wrong with , modules which use awt packages have files identical to the effected module and they compile without an issue.  




IntelliJ IDEA never adds these options automatically, there is a quick fix that adds it, but it must be invoked manually by the user, see .


I see five checkboxes for javac on that cnofiguration page. Which one caused the entry in the table? AFAIK I have never checked or unchecked anything from this page. 


This intention action in the editor adds the options to the compiler:

It does not happen automatically.


FYI all it takes to trigger this compilation error is a completely empty project with 0 (zero or more) classes in  a module which requires java.desktop in its and the presence of this compiler option. It's hard for me to imagine a modular project which would require this compiler option but yet has not  already required java.desktop. In any reasonable use case scenario I can think of, its addition is going to happen after java.destop has already been required  but I haven't seen as many use cases as JB has so I defer to your judgment. It seems like offering it as a suggestion might lead the developer to a loss of productivity as they try to run down the near infinite false possibilities which could possibly produce an error like this one.




Hello java developer,

Can you please describe in more details the issue that you experience. What compiler option do you have by default in empty project created that affects the compilation? Can you please share the sample of such a project (please create an issue at the YouTrack,, attaching the sample or upload it to the and share the project name here)? 


Thank you 



 I described above what it takes to trigger the situation. I just checked back here because it happened again and I couldn't recall the solution .. lol... nothing I  am doing except what I  described above.  I am not taking any fast suggestion / auto-completion option except to require(s) javadesktop in the file  when a class I wrote  uses awt in the module I wrote and desktop is not already required. That's all it takes. If you can't  repro using my previous post I am not sure I can offer any more insight.




Thank you. 


Hello java developer,

In case I use i.e.


Package java.awt is declared in module java.desktop thus the suggestion to add it to module-info is quite reasonable. Please explain what behaviour do you expect?

When does the collision between the 

requires  java.datatransfer;
requires java.desktop;

occur for you?




 Hi. Thanks for looking at this. What I am understanding is you did what I described in my post above dated:

using java.awt.Point and did not have the problem I described.
I will do as I described using java.awt.Point as you did and then report back what happens back to you. 

java developer


Yes, I'm checking the described steps with v2020.2 Beta (


Hi Olga,

I did it again and got the same result. If it's not happening on your machine then that's cool; I'll try to work it out from here.

Thanks !


java developer,

Sharing your sample project may really help to find out what the problem can be ( or Unfortunately for now it's not quite clear :(


Please sign in to leave a comment.