File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes noob cp problems in webapp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "noob cp problems in webapp" Watch "noob cp problems in webapp" New topic
Author

noob cp problems in webapp

La Noobie
Greenhorn

Joined: Jun 12, 2003
Posts: 1
I'm trying to write a simple jsp/servlet app.
I have set up dir structure like this:
-Root
-WEB-INF
-classes
-org
-noobie
-lamer
I have 2 classes called Example1.java and Example2.java both in package org.noobie.lamer.
I cannot compile Example2.java because it cannot find Example1.class. I keep getting unresolved symbol errors. Here is part of my Example2.java.


This is one error:

Both Example1 and Example2 are in package org.noobie.lamer. I am compiling from within the classes/org/noobie/lamer/ directory and Example1.class exists there. Here is my javac command:

So what am I doing wrong?
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

Compile them both together. javac *.java or better yet check out Ant.

Barry
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You need the classes directory in your classpath.
In your case "Root/WEB-INF/classes" must be in the classpath.
-Another Barry


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

Do check out ant for simplifying your life immeasurably.
Also, you will find more JSP help in the JSP Forum.
And once you have your web server set up for your app context, the folder /WEB-INF/classes will automatically be in the server's classpath. No other special config is needed.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
La Noobie,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to conform to the JavaRanch naming policy.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: noob cp problems in webapp