문제

I am having some issues with importing library which is needed to complete an assignment that I have been set.

I'm not sure if I have added the library to the project, but the classes from the library appear to be in the libraries section of the project.

http://imgur.com/Co6IOzq,qCJaXHh,ZJVUnbZ

I added the libraries by right clicking on project1 and going to properties:

http://imgur.com/Co6IOzq,qCJaXHh,ZJVUnbZ#1

However whenever I have "package project1" at the top of Project1.java I receive a message that MaInput - which is one of the classes in this library - is not recognised:

cannot find symbol: symbol: class MaInput

Whenever I take away "package project1" when trying to compile it reads: Error: Could not find or load main class project1.Project1 Java Result: 1.

올바른 솔루션이 없습니다

다른 팁

The problem is that you are trying to access a class from default package from a named package and this is not allowed by the Java Specification.

So, in this case, create your assignment in the default package as well.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top