Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDK 1.4 and packaging

Status
Not open for further replies.

iSeriesCodePoet

Programmer
Jan 11, 2001
1,373
US
I am working on a program and am having a problem. I am using JDK 1.4 and can't compile a program becuase it is expecting an import in a package. How do either get around it or fix it? Everything is in the same directory.

Assgn3/Queue.java [6:1] '.' expected
import SimpleLinkedList;
^ Mike Wills
AS400 Programmer
[pc2]

Please, if you find my post useful, let me know. [thumbsup2]
 
If your class is in the Default package (ie no package) then you do not have to explicitly import it.
 
Thanks, I will try that! Mike Wills
AS400 Programmer
[pc2]

Please, if you find my post useful, let me know. [thumbsup2]
 
Okay, now I get another error. What needs to be done here?

Assgn3/Queue.java [9:1] cannot resolve symbol
symbol : class SimpleLinkedList
location: class Queue
private SimpleLinkedList data = new SimpleLinkedList();
Mike Wills
AS400 Programmer
[pc2]

Please, if you find my post useful, let me know. [thumbsup2]
 
Have you compiled the SimpleLinkedList class yet? Is Queue and SimpleLinkedList both found in the same directory? This will make things easier, otherwise you will need to make sure SimpleLinkedList is on the CLASSPATH.
 
I figured it out. I removed the packaging information and that is when it didn't work. When I added that back, it works fine. Mike Wills
AS400 Programmer
[pc2]

Please, if you find my post useful, let me know. [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top