File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts" Watch "struts" New topic
Author

struts

Eldo Zacharia
Greenhorn

Joined: Nov 08, 2004
Posts: 5
hi ,
I am very much new to struts ..so i have a problem compiling and building struts application .. i have followed the standard directory structure ..buti get the errors below during compilation this is the classpath i have set in the environment variable section (windows xp)
C:\j2sdk1.4.\jre\lib\rt.jar;.;C:\ProgramFiles\Tomcat\common\lib\servlet.jar;.;C:\struts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\classes

and i use the following .bat file on the cmd line to complie

set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;cp
javac -d ..\..\..\classes *.java

Iam doing anything wrong plz let me know if iam

anyone help.


this is the output on the cmd window
C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set_classpath

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\li
b\struts.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp =;C:\Program Files\Tomcat\common\lib\servlet.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set classpath=C:\j2sdk1.4.0\jre\lib\rt.jar;.;C:\Program Fi
les\Tomcat\common\lib\servlet.jar;.;C:\struts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\Min
iHr\WEB-INF\classes;cp;cp

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>javac -d ..\..\..\classes *.java
SearchAction.java:8: cannot resolve symbol
symbol : class ActionFoward
location: package action
import org.apache.struts.action.ActionFoward;
^
SearchAction.java:16: cannot resolve symbol
symbol : class HttpRequest
location: class com.miniHr.SearchAction
HttpRequest request,
^
SearchAction.java:17: cannot resolve symbol
symbol : class HttpResponse
location: class com.miniHr.SearchAction
HttpResponse response)throws Exception
^
SearchAction.java:14: cannot resolve symbol
symbol : class ActionFoward
location: class com.miniHr.SearchAction
public ActionFoward execute(ActionMapping mapping,
^
Guido Schoepp
Greenhorn

Joined: Oct 14, 2004
Posts: 21
Originally posted by Eldo Zacharia:
set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;cp


Try this:
set classpath=%classpath%;%cp%

Guido
Eldo Zacharia
Greenhorn

Joined: Nov 08, 2004
Posts: 5
hi ,Thanks a lot for the reply to my question ... but iam still facing the same proble ....This is what i get at the cmd window

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set_classpath

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp = C:\Progra
m Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp =;C:\Progra
m Files\Tomcat\common\lib\servlet.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set classpath=C:\j
2sdk1.4.0\jre\lib\rt.jar;.;C:\Program Files\Tomcat\common\lib\servlet.jar;.;C:\s
truts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\Min
iHr\WEB-INF\classes;.;C:\j2sdk1.4.0\bin;;

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>javac -d ..\..\..\
classes *.java
SearchAction.java:8: cannot resolve symbol
symbol : class ActionFoward
location: package action
import org.apache.struts.action.ActionFoward;
^
SearchAction.java:16: cannot resolve symbol
symbol : class HttpRequest
location: class com.miniHr.SearchAction
HttpRequest request,
^
SearchAction.java:17: cannot resolve symbol
symbol : class HttpResponse
location: class com.miniHr.SearchAction
HttpResponse response)throws Exception
^
SearchAction.java:14: cannot resolve symbol
symbol : class ActionFoward
location: class com.miniHr.SearchAction
public ActionFoward execute(ActionMapping mapping,



the set_class path.bat file which i use is

set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;%cp%
javac -d ..\..\..\classes *.java

thanks again
Guido Schoepp
Greenhorn

Joined: Oct 14, 2004
Posts: 21
Originally posted by Eldo Zacharia:
set classpath=C:\j2sdk1.4.0\jre\lib\rt.jar;.;C:\Program Files\Tomcat\common\lib\servlet.jar;.;C:\struts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\classes;.;C:\j2sdk1.4.0\bin;;


I really don't know if the CLASSPATH is case sensitive in Windows but try it:
set CLASSPATH=%CLASSPATH%;%cp%

Otherwise try to set the classpath by parameter of javac:
javac -classpath %classpath% -d ..\..\..\classes *.java

Guido

...and use struts 1.2.4 instead of 1.1-b2...
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

and use struts 1.2.4 instead of 1.1-b2...

Or at least using 1.1-b3, which is the final release of Struts 1.1

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
the set_class path.bat file which i use is

set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;%cp%
javac -d ..\..\..\classes *.java


please try follow me

- create src, classes, lib in c:\
- copy struts.jar to c:\lib directory and
- copy all source code to c:\src directory


set p=c:\classes

set cp=C:\lib\struts.jar

set classpath=.;%p%;%cp%;%classpath%

javac -d %p% *.jar



This will help you to solve problem.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Eldo Zacharia
Greenhorn

Joined: Nov 08, 2004
Posts: 5
hi thanks a lot for all ur help i was finally able to make a jar file ....will need ur help in near future ..
thank a lot
Eldo Zacharia
Greenhorn

Joined: Nov 08, 2004
Posts: 5
hi I have come over the problem and sloved the problem ...i was placing my *.java files in a wrong folder..
Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts
 
Similar Threads
problem with struts
compilation error
can not be able to compile Action Class
JDBC on postgres
package org.apache.struts.action does not exists