Take the 2-minute tour ×

I usually don't have any problems setting up the classpath and running programs, but I'm running into a bit of a problem. I'm working on a program that will download a series of reports. If the working directory is called Report downloader, my project resides in


and the jar files I'm working with reside in


When I'm going to compile my project (I'm in windows :( ) I type in

javac -classpath .;..\..\..\..\..\lib.transfer.jar; ..\..\..\..\..\lib.someotherjar.jar; ReportGrabber.java ReportDriver.java

I get an error message saying

ReportDriver.java:12: error:package com.transfer does not exist
import com.transfer.*;
1 error

And I don't really understand why. I'm trying to import a valid package, and I showed it where to find the jar in the classpath and it's still giving me grief.

I'm losing my mind, I feel so dumb for asking about this. I could give up and just use eclipse but I really want to figure this out.

EDIT: When I type

java -cp .;..\..\..\..\lib\transfer.jar; ..\..\..\..\lib\someotherjar.jar; ReportDriver

to run the file, I get an error saying

Error: could not find or load main class ..\..\..\..\lib\someotherjar.jar;

Any ideas?

share|improve this question
You realize your classpath has a lib.transfer.jar and not lib\transfer.jar ? –  Kal Dec 29 '11 at 17:26
What have you tried? –  hellectronic Dec 29 '11 at 17:30
@Kal that was a typo –  Tom Dec 29 '11 at 17:47
add comment

2 Answers

up vote 2 down vote accepted

Why are there 5 .. instead of 4?

to access your lib directory from reportdownloader, you have to do



share|improve this answer
Seems to me the right thing. +1 for that. Regards –  nIcE cOw Dec 29 '11 at 17:40
Yes thank you that worked. I knew it was something dumb. If you could look at the edit I made, it is saying that it can't find or load the main class in one of my jars. –  Tom Dec 29 '11 at 17:47
@Tom Glad it worked for you. Can you please accept this answer then. –  Adel Boutros Dec 29 '11 at 18:30
add comment

Using a relative path seems like a bad idea to me.

Why not do this:

... -classpath /lib/transfer.jar /lib/someother.jar

or in windows:

... -classpath c:\lib\transfer.jar c:\lib\someother.jar
share|improve this answer
add comment

Your Answer


