File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem running Struts Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem running Struts Application" Watch "Problem running Struts Application" New topic

Problem running Struts Application

Abhik Ghosh
Ranch Hand

Joined: Feb 28, 2008
Posts: 32
I have the following:

apache-tomcat-6.0.20 in C:\apache-tomcat-6.0.20 ,
struts-2.1.6-all in C:\struts-2.1.6-all,
JAVA_HOME is C:\Program Files\Java\jdk1.5.0_10\bin
CLASSPATH is .;C:\apache-tomcat-6.0.20\apache-tomcat-6.0.20\lib\servlet-api.jar;C:\apache-tomcat-6.0.20\apache-tomcat-6.0.20\webapps\user1\WEB-INF\classes
PATH is C:\Program Files\Java\jdk1.5.0_10\bin

I have my application in C:\apache-tomcat-6.0.20\apache-tomcat-6.0.20\webapps\user1

When I try to compile the java files from

i get the error: package org.apache.struts.Action does not exist
import org.apache.struts.Action.*;
^ package org.apache.struts.action does not exist
public class LoginForm extends org.apache.struts.action.ActionForm
2 errors

This looks like a classpath problem, but i don't get it.

Please help.

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

You're not misconfigured the struts jar files only, but also taken a wrong Struts version, the org.apache.struts.Action class comes in Struts1.x and you're using Struts 2.
So download the Struts 1.3.9 build and set those jar in classpath.

And please carefully choose the forum, its not Struts section.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Moved to the Struts forum.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Problem running Struts Application
It's not a secret anymore!