aspose file tools*
The moose likes Cattle Drive and the fly likes DaysOld and classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "DaysOld and classpath" Watch "DaysOld and classpath" New topic
Author

DaysOld and classpath

Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
OK, I can compile fine using the provided zip file and javac and classpath settings. I can't seem to convince java.exe to behave similarly.
Any advice?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
The error I get is the old NoClassDefFoundError
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Also known as GoJumpInALakeError
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
OK, I know what I did wrong.
The classpath setting for javac doesn't need to include the location of the class that I'm about to create. So, not specifying the current working directory (the one where the class file I'm creating will be) is no problem. java does need to know the location of all class files I want to use - including the location of the class I am executing (which for some asinine reason it can't find all by itself if it's in the current working directory). The solution then becomes:
java -classpath ".;.\whatever" SomeClass [someArguement(s)]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I'll leave this monologue for future perusers (me in a month).
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Originally posted by Dirk Schreckmann:
The error I get is the old NoClassDefFoundError

Yeah, it's the one I call java.lang.Nope
Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1752
    
    2
Yep, one of the best tricks I learned is
java -classpath . SomeClass
My machine at work is locked down and I can't change the path or classpath, so I wind up having all sorts of path and classpath adventures when I get the urge to do some Java on the sly. (My work doesn't involve Java programming, as you could probably guess.)
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Originally posted by Michael Matola:
Yep, one of the best tricks I learned is
java -classpath . SomeClass
My machine at work is locked down and I can't change the path or classpath, so I wind up having all sorts of path and classpath adventures when I get the urge to do some Java on the sly. (My work doesn't involve Java programming, as you could probably guess.)

Thomas Paul introduced me to an even better trick . . . Ant.


Matthew Phillips
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
Someone not knowing about what Ant means:
A sort of makefile using XML (extended markup language) and Java.
Ant is available from jakarta.apache.org
Worthwhile!
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Thomas Paul also wrote about ant in the JavaRanch Newsletter in March.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DaysOld and classpath