Question

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.

No correct solution

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top