File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Setting Classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Setting Classpath" Watch "Setting Classpath" New topic

Setting Classpath

MI Mohammed
Ranch Hand

Joined: Feb 16, 2005
Posts: 146
Pls can someone help me out.Am i deep shit.
Ok. I tried to use java bean in my Jsp page.
But the problem is the container can't find the
bean class.
The steps i used is as follows.

1. created a package c:\musa.
2. Wrote a BeanDemo Class to return and set String.
and package statement.
package com.mimoh.bean;
3. Went to my enviromental variable( WinXp)
and added .;C:\musa
4. from my source folder at C:\source
i compiled the code as follow
javac -d C:\musa
and got a compiled code at
5. Now the problem. When i tried to import it
into my jsp page. Just got classNotFoundException.
To check the problem, created a main() in the
BeanDemo class and ran it with
java -classpath c:\musa Just instatiated
the BeanDemo class. But still got the same result.
pls least i forget, when i dir in the folder,
the class was there.

Never say it, just do it n show it
SCJP 1.4

SCJA(Beta) SCJP 1.4 SCWCD 1.4 SCBCD 1.3 SCBCD 5.0 beta <br />The more practice we get, the better we are at the exams and in life in general. Pls join me at My DEN.
Sergey Tyulkin
Ranch Hand

Joined: May 10, 2005
Posts: 87
Why don't you put your class to the web application's WEB-INF/classes directory?
I agree. Here's the link:
subject: Setting Classpath
It's not a secret anymore!