Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java util package

 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its ok i've got it to work
cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic