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

Question about classpath?

Status
Not open for further replies.

csphard

Programmer
Apr 5, 2002
194
US
I am trying to learn how to create a package. I am reading this link.
My question is about the CLASSPATH. Not sure where to put this or if I need it.
I am using the IDE Eclipse

I am at the part setting up the CLASSPATH.

STEPS I have taken.

CREATED PACKAGE

package world;

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

My package is in the following directory and compiled.
C:\java_samples\learning\src\world

I created the following CLASSPATH VARIABLE.

Name: MyClassPath_LEARNING
PATH:C:/java_samples/learning/src/world

Then I created this class

import world.*;
public class testPackage {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
HelloWorld helloWorld = new HelloWorld();
}

}

There is an error with the import world.*;
It is squiggly underline and it states
The import world is never used.

Please let me know if this is enough information or if there is simpler tutorial
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top