File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Classpath

 
MI Mohammed
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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 BeanDemo.java
and got a compiled code at
C:\musa\com\mimoh\bean\BeanDemo.class
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 TryBeanDemo.java( 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
 
Sergey Tyulkin
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you put your class to the web application's WEB-INF/classes directory?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic