I\'m starting use the IntelliJ-IDEA
, but my java
files doesn\'t detect errors like imports for example. I don\'t create one project java
,
Intellij can work very well standard project layouts. If yours is not standard - tell Intellij how it is structured: from open workspace, select File -> Project Structure (Ctrl+Alt+Shift+S), and go through all the tabs to setup specifics:
The most important tabs are probably:
Assume you have two java files in your project:
package com.myproject // this one have package
public class SomeClass{
//whatever
}
and
public class Main {
// whatever - no package
}
so you should have them inside some directory:
directory
|- com
| |- mypackage
| |- SomeClass.java
|- Main.java
In such structure - the directory
is sources root. Mark it as such