Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...love the site and am constantly recommending it to (selected !) clients here in ireland..."

Geography

Where in the world do Tek-Tips members come from?

Question about classpath?

csphard (Programmer)
16 Jul 12 11:37
I am trying to learn how to create a package. I am reading this link. http://www.jarticles.com/package/package_eng.html

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
Diancecht (Programmer)
19 Jul 12 18:50
What if you use

CODE

import world.HelloWorld; 
?

Cheers,
Dian

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close