i m able to compile NameForm.java, but when i compile NameAction.java, i m getting following errors:
NameActio.java:19:can not resolve symbol
symbol:class NameForm
location:class example.NameAction
NameForm nameForm=(NameForm)form:
like this i m getting 4 can not resolve symbol errors.
can anybody help me???
Thank you.
Can you show us the directory structure of your app i.e. the location of the NameForm.java and NameAction.java and how you are compiling these files...
my application's directory structure is as shown below:
StrutsApp
|
|--WEB-INF
| |--classes----example
| |--lib |--NameForm.java
| |--tlds |--NameAction.java
| |--web.xml
| |--struts-config.xml
|--index.jsp
|--displayame.jsp
*)and i have set path and classpath with following values:
path=E:\bea\jdk142_08\bin;E:\progs\StrutsApp\WEB-INF\classes\example;E:\bea\weblogic81\server\lib\weblogic.jar;E:\bea\weblogic81\server\lib\webservices.jar;E:\struts-1.2.6\lib\struts.jar;
classpath=E:\bea\jdk142_08\bin;E:\progs\StrutsApp\WEB-INF\classes\example;E:\bea\weblogic81\server\lib\weblogic.jar;E:\bea\weblogic81\server\lib\webservices.jar;E:\struts-1.2.6\lib\struts.jar;
*)and i m compiling as shown below:
E:\progs\StrutsApp\WEB-INF\classes\example>javac NameAction.java
after above step i m getting four "can not resolve symbol" errors.
But i have successfully compiled NameForm.java file and facing problem in compiling NameAction.java.
can you please see though it.
Naveen, since the classes are in the example package, so you must not compile the files from the example directory. Instead compile the classes from the WEB-INF\classes directory like javac example\NameAction.java.
Also usually a folder named src in the WEB-INF directory is used to store source files i.e. .java files. You can compile .java files in src folder to classes folder (so that the .java files are in src folder and .class files are in classes folder) using the -d flag of the javac command. Search on the internet for more information on the javac command...
Naveen Megharaj
Ranch Hand
Joined: Feb 13, 2009
Posts: 39
posted
0
i agree with what all you have told.... i tried compiling it from the classes folder as you told, but even then i m getting the same errors. The problem is that the compiler is not able to locate "NameForm.java". if i remove all the statements related to NameForm class in NameAction.java, then it is compiling successfully. one of my friend told that there might be problem with path and classpath!!! what you have to say about this. Please provide some solution.
Thank you.
Why are there JAR files in your path? They're not executable.
You need to include the directory your class files are in on the classpath, although setting a classpath environment variable may not be the most efficient way to do this.