Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cant compile servlets  RSS feed

 
Downey Smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am learning java jsp and servlets, the book i bought , murach's jsp and servlets uses netbeans for all of its projects.
i want to do it by using, ultraedit or editplus , or textpad, but i cant compile the .java classes because it cant find those .java files even it is in the same directory.
i have this structure:

[webapp1] --> [WEB-INF] , [src] , test.html , sample.jsp
[WEB-INF] --> [classes] , web.xml
[classes] --> ( the compiled java .class files)
[src] --> User.java, UserIO.java , AddToEmailListServlet.java

when i want to compile , User.java, UserIO.java and AddToEmailListServlet.java
javac UserIO complains about not finding User.java even though it is in the same directory [src]

then i changed to match the way netbeans uses :
basically i created separate folders to put the individual java files :

[src] --> [business] , [data] , [email]
[business] --> User.java
[data] --> UserIO.java
[email] --> AddToEmailListServlet.java

so now the these java would use packages same as netbeans
Assume all required imports for servlets are there.






so when i try to compile this, User.java compiles but UserIO.java doesnt because it can find symbol User.
So how do other people make java web applications without using netbeans or intelliJ ?

NOTE: this compiles and runs perfectly using netbeans and intelliJ , the problem is using a text editor.



 
PankajKumar jaiswal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the current directory has been added in the classpath? When you will want to compile UserIO, its unable to find User.class means that it's not in the classpath. Check classpath has it or not?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!