eclipse project : how to import correctly a class

84 views Asked by At

I'm having this issue while developing in Java using Eclipse as my IDE

I have this class path:

src\main\java\com\server\wsname\path\to

When i write "package ..." like

package com.server.wsname.path.to 

it gives me this error:

The declared package "com.server.wsname.path.to" does not match the expected package "main.java.com.server.wsname.path.to"

but if i write "package ..." like:

package main.java.com.server.wsname.path.to

everything works fine.

I have the same issue with the import statement, but in this case the error message is "the import cannot be resolved."

Am i missing any configuration property in the IDE related to this?

Thanks in advance.

1

There are 1 answers

0
Marcos Vasconcelos On

Right click the project, go on Configure Build Path.. and set 'java' folder as the source location.