• 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

setting classpath ????

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
im facing a problem with setting the classpath on Tomcat 4.0.. hmm lemme explain it.
I kept a servlet inside the package
test.common
the name of the servlet is GenerateMenu.java
ie the servlet path is
..web-inf/classes/test/common/GenerateMenu.java.
I want to use a JavaBean to store some values..
i kept the Bean (MenuBean.java) inside classes directory .ie the path of bean is
..web-inf/classes/MenuBean.java
i set the classpath to the classes directory..
I was able to call files from another packages like test.dbase.DBConnectionManager from
GenerateMenu, but after its showing compilation error for the MenuBean which i kept inside the classes directory.
the complation o/p is

GenerateMenu.java:30: cannot resolve symbol
symbol : class MenuBean
location: class test.common.GenerateMenu
MenuBean menu; ^
GenerateMenu.java:66: cannot resolve symbol
symbol : class MenuBean
location: class test.common.GenerateMenu
menu = new MenuBean();
^
2 errors

can any1 tell me how to solve this ???
thanx
Raj

SCJP2
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i solved it..i had to add

import MenuBean;

inside the GenarateMenu.java file...
it was silly doubt naa !!!
Thnx
Raj..
SCJP2
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi raj,
can u pls tell me..how u set up JAVA_HOME and CATALINA_HOME variables?
I am using Win Xp professional.
I went into control panel>system> environmant variables and set up the path variable.
When I start the startup.sh it says those variables are not set. What could be the problem. I read all the possible documents on the net. but still it won't work.
Can u help me?
Thanks.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you open a new console window after setting the environment variables? Existing console windows will not pick up the changes dynamically.
hth,
bear
 
N Val
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for the response. I did open a new console...infact i restarted my system too...but it won't work.
i even tried to manually edit the catalina.sh file by setting the path...
same error again .
what could be wrong?
thanks.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I run catalina.bat instead of catalina.sh on WinXP.
And actually i didn't have to set CATALINA_HOME. For JAVA_HOME I created the new variable JAVA_HOME where you mentioned before, "control panel>system> environmant", instead of adding to the 'path' variable.
Hope that helps.
[ March 07, 2003: Message edited by: Dave Jochim ]
 
N Val
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dave,
thanks for the reply.
What exactly did u do with catalina.bat? did u change any variables in that?
thanks
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
the best thing u can do is create ur own .bat
file in which u can include all classpaths & homepaths. every time u startup ur PC ,run ur bat file from command prompt.
Praveen
 
Dave Jochim
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi N Val,
No, I didn't make any changes to catalina.bat. I think having JAVA_HOME set was the only thing I adjusted to first get it running.
 
Beware the other head of science - it bites! Nibble on this message:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic