• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem while copying class file

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
straws are for suckers. tiny ads are for attractive people.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic