aspose file tools*
The moose likes Beginning Java and the fly likes Problem in Compilation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in Compilation" Watch "Problem in Compilation" New topic
Author

Problem in Compilation

mi blrin
Greenhorn

Joined: May 26, 2008
Posts: 5
1) while compiling from dos, I got error's like:

a) package javax.servlet.http does not exist at
import javax.servlet.http.HttpServletRequest;

b) package org.apache.struts.action does not exist at
import org.apache.struts.action.ActionForm;

what's the problem, can anyone explain?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18829
    
  40

Both of those mentioned are *not* classes, that are by default, part of the standard JDK. I am assuming that you installed those packages, and have placed them in your classpath?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
mi blrin
Greenhorn

Joined: May 26, 2008
Posts: 5
originally by Henry

I am assuming that you installed those packages, and have placed them in your classpath?
------------------------------------------------------------------------

Henry Thank's for reply,

I have neither installed these packages nor placed them in classpath

may be some different problem, someone please sovle.

Thanks for All
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18829
    
  40

I have neither installed these packages nor placed them in classpath

may be some different problem, someone please sovle.


Well, if you have "neither installed these packages nor placed them in the classpath", then how do you expect the compiler to magically find them?

The compiler is complaining that the classes "does not exist". Why do you think these problems are not related?

Henry
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Originally posted by mi blrin:
originally by Henry ...
I have neither installed these packages nor placed them in classpath
...

Hi Mi,

Welcome to JavaRanch.

The error says that it is not able to find those classes (HttpServletRequest and ActionForm) while executing import statement.

In order to compile and run the application you need to include appropriate jar files and put them into classpath also.

Please tell us if you get any problem after doing this.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30512
    
150

"a" ios from a jar called j2ee.jar or servlets.jar. "b" is from a jar called struts.jar.

The first step is to locate these files. You don't really install jars as they aren't executable. I think Henry meant to ask whether you downloaded/imported them.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Compilation