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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot find symbol

Status
Not open for further replies.

Ghodmode

Programmer
Feb 17, 2004
177
NZ
I have two classes that are part of a basic "Hello World" type of example from the Wicket project. I'm getting an error that says "cannot find symbol". My first thought was that it was related to the CLASSPATH (even though I know that error is ClassNotFoundException), but the class that it's looking for is in the current directory and "." is in the classpath.

Here's the command and output:
Code:
home:/opt/tomcat/webapps/helloworld1/WEB-INF/classes$ CLASSPATH=/opt/tomcat/webapps/helloworld1/WEB-INF/lib/wicket-1.3.0-beta3.jar:. javac HelloWorld1Application.java
HelloWorld1Application.java:9: cannot find symbol
symbol  : class HelloWorld1
location: class mypackage.HelloWorld1Application
                return HelloWorld1.class;
                       ^
1 error

Here's the code I'm trying to compile:
Code:
package mypackage;

import org.apache.wicket.protocol.http.WebApplication;

public class HelloWorld1Application extends WebApplication {
	public HelloWorld1Application() { }

	public Class getHomePage() {
		return HelloWorld1.class;
	}
}

What am I doing wrong? I know it must be something very basic.

Thank you,


--
-- Ghodmode

Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.
 
I figured it out. It was a classpath issue. The classpath needed to reference the beginning of the package. Since both classes were simply in a package named "mypackage" and I was in the mypackage directory, I needed to reference ".." rather than just "." in my classpath.

--
-- Ghodmode

Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top