• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

problem with classpath..need help..

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have installed tomcat 4.0.4 and its working fine.I have tried to create development directory c:\devel and started writing servlets.. but I am not able to complie my servlets.
c:\devel\javac HelloWorld.java gives Bad command or filename.
this is my autoexec.bat
set JAVA_HOME=C:\jdk1.4
set CATALINA_HOME=C:\jakarta-tomcat-4.0.4
SET PATH=C:\jdk1.4\bin; %PATH%;
Set CLASSPATH=.;C:\devel;C:\jakarta-tomcat-4.0.4\common\lib\servlet.jar
Please tell me what is wrong and what do I need to compile servlets?
Thanks,
Radhika
SCJP
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try taking that last ; off the end of your PATH statement. Apostrophes only seperate entries, they are not line terminators, like in Java programs.

Also, remove the space between ; and '%PATH%'
[ November 01, 2002: Message edited by: Mike Curwen ]
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is no servlet classes in ur package. So download them and then execute them
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Surely the problem here is that javac is not in c:\devel? It is in c:\jdk1.4\bin
Hence your command should be
c:\jdk1.4\bin\javac HelloWorld.java
This is of course assuming that you are in the same directory as HelloWorld.java and that HelloWorld.java is in the default package (ie has no package statement at the top of the file)
Hope that helps
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jesse, that is what the PATH is for.

So you don't need to be in the same directory as the compiler, when you try to invoke it. The error is a DOS error, so it's a PATH issue.
 
Radhika Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike,
I have tried removing ; and space. Now its working fine..Thanks for your help..

Radhika
SCJP
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic