• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while copying class file  RSS feed

 
swichika reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i am new to tomcat server.
i have small problem of copying class files from bin to classes folder.

i have read that after compiling the java file it shud be moved to %TOMCAT_HOME%/webapps/examples/WEB-INF/classes.

I have done this using copy command at command line as below

c:\jakarta-tomcat-3.2.2\bin\ copy Helloworld.class c:\jakarta-tomcat-3.2.2\webapps\examples\classes

but 0 files are copied.


but the class file is copied successfully in examples folder and ouput is also displayed in browser.

I tried all possible means, it didn't work. Actually before posting, I read then try to implement but it is only working in c:\jakarta-tomcat-3.2.2\webapps\examples


can any one tell me if class file has to be copied to examples folder or classes folder.

if to classes folder what is the syntax.

thanks

bye
 
Ravinder S Edhan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


Normally the class files are copied to the classes folder. If you have a package structure then first package goes to classes folder and then the class files to their respective folder.

Instead of using the copy(DOS) command, why don't you directly put the class file in the destination folder while compiling the file.

Command for this would be like:

javac -d <destination path> <source path>, where -d specifies the destination path.
In your case it would be something like this

c:\jakarta-tomcat-3.2.2\bin>javac -d c:\jakarta-tomcat-3.2.2\webapps\example\classes c:\jakarta-tomcat-3.2.2\bin\HelloExample.java

Hope this would solve your problem

Cheers
Ravinder S Edhan
SCJP 1.4
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!