File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes java util package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java util package" Watch "java util package" New topic
Author

java util package

Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
hi
i want to use the stringtokenizer class from the java util package but dont want to downalod j2se to do this - can anyone point me to a smaller jar file which contains the java util package as a downalodable jar, so that i can just put in my web-inf/lib file ?
cheers
chris


One day all greenhorns will run free ...
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

StringTokenizer is part of the core Java APIs. By definition, if you're running Java code, it can "import java.util.StringTokenizer" and just use it. You don't have to download anything else.


[Jess in Action][AskingGoodQuestions]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
How are you programming in Java without a full version of the Java API available? What environment are you using? As Ernest mentions, you can just import the StringTokenizer class in order to use it. As part of the core Java API, it should already be available from within whatever development environment you are using.
Layne


Java API Documentation
The Java Tutorial
Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
thanks, i confused myself.
i'm trying to compile the file using the unix (os -sun solaris)command

but its giving me the following error

here is the class

and an extract showing the structure of the api which the legallist comes from

is it the end of the file or could the compiler error be anywhere in the compilation command ?
cheers
chris
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Given the error message, I'd say that "WEBTOP" variable is not defined, and so javac simply can't find your source file.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The problem is that the javac command can't find your source file in the directory indicated. As mentioned, it looks like the WEBTOP variable isn't even defined. You can use the following command to see its value:

If you just get a blank line, then the variable isn't defined. If you set the value yourself in .bash_profile be sure you also have a line with something like

You can have more than one variable listed in the export command.
Other than that, I've run out of guess about what you can do to fix the problem. Perhaps you can explain the directory structure of the location of your .java files.
HTH
Layne
Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
thanks.
the problem was my directory structure - the $WEBTOP variable was defined in the .profile file (i'm running the korn shell).
now i'm getting the error follwing messages

in the compilation command i specify the webtop.jar file which contains the class named legallistbean, this is then referenced in the list class by the command - import webtop.beans.legalist;
here is the class - i've changed the call to the LegalList class to the correct case but i can't see what else

cheers
chris
Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
its ok i've got it to work
cheers
 
GeeCON Prague 2014
 
subject: java util package