• Post Reply Bookmark Topic Watch Topic
  • New Topic

setting up package at classpath  RSS feed

 
Suka Hati
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. does it need to set the package directory in the classpath?
2.
 
Suka Hati
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry...
2.
 
Suka Hati
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry again....some silly mistake
2. is it enough...if i want to use a package in my servlet...i just import it....e.g

import bla.*;
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to import a package, that package root directory must be in class path.

eg. com.test.mypackage is the package.

and you are have your source java file Test.java in C:\MyJava folder and you are importing the mypackage in your source file.

and this com directory is in C:\MyJava drive. then.. the folder MyJava should be in Classpath, while compiling and executing the source file Test.java

set classpath=C:\MyJava;%classpath%
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But note that Tomcat does not pay any attention to your environment CLASSPATH, instead it has its own conventions on where to find class files - see the class-loader-howto.html file under tomcat-docs in your Tomcat installation.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!