m.d
m.d

Reputation: 179

Can't import java.awt.* and javax.swing.* in Intellij

The title said it all. I can't import neither java.awt.* nor java.swing.* in Intellij Idea. This is my project structure.

project structure

java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

Upvotes: 4

Views: 6255

Answers (1)

m.d
m.d

Reputation: 179

This is how i done it. It seems that i need to include a module-info.java file

module-info.java

and inside that put the follwoings.

module project.name {
    requires java.datatransfer;
    requires java.desktop;
}

I can't come up with a better answer right now. but this solved the initial problem.

Upvotes: 9

Related Questions