0

I setup classpath in enviroment variables i set a user variable named classpath with value= .;C:\Users\Borut\Downloads\httpcomponents-client-4.1.2-bin\lib

the directory is full of .jar files. yet still when i run a program through cmd it reports an error that the package from the class does not exist.

1
  • You need to name the jar files themselved on the classpath. Commented Oct 3, 2011 at 19:36

2 Answers 2

2

Historically, you've needed to include the jar files themselves, not the directory they're in, on the CLASSPATH. In recent JREs, you can use a wildcard (i.e., a path ending in /*) to indicate all the jars in a directory. But if you indicate only a directory, then that directory is searched for class files and packages only; jar files are ignored.

Sign up to request clarification or add additional context in comments.

Comments

1

You need to either (a) explicitly list the jar files, or (b) use a wildcard classpath (1.6+).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.