Accepted answer

the src directory is the default directory where eclipse stores the source code, while in maven is src/main/java. better check if the .classpath file has not been corrupted or externally modified. it should contain something like this:

<classpathentry kind="src" output="target/classes" path="src/main/java">


the code line
in the helloworld project results in this package hierarchy:

`-+ java
  `-+ helloworld

is that really what you mean?
in a maven project, you have this directory structure:

`-+ main
|   `-+ java
|   |   `-+ <here your packages and classes>
|   '-+ resources
'-+ test
|   `-+ java
|   |   `-+ <here your test packages and classes>
|   '-+ resources

src/main/java (production code) and src/test/java (tests only) are the root of your package hierarchy. if you create the nested packages com.enterprise within test/java and create a class test within enterprise, then you have to insert this package declaration in
package com.enterprise;

take a look at your directory and package structure in the helloworld project.

Related Query

More Query from same tag