Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile files that ref each other?

 
Jim Crawford
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you compile to java source files that reference each other?!?
Not quite related to the thread, but quite related to the thread as well.
 
Jim Crawford
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..thought this would work, but doesn't.
javac SharedSessionBean.java AbstractSearchBean.java
SharedSessionBean.java:30: cannot resolve symbol
symbol : class AbstractJSPBean
location: class netconSearchApp.SharedSessionBean
public void putJSPBean (String p_pageCode, AbstractJSPBean p_JSPBean) {
^
SharedSessionBean.java:38: cannot resolve symbol
symbol : class AbstractJSPBean
location: class netconSearchApp.SharedSessionBean
public AbstractJSPBean getJSPBean (String p_pageCode) {
^
SharedSessionBean.java:39: cannot resolve symbol
symbol : class AbstractJSPBean
location: class netconSearchApp.SharedSessionBean
return (AbstractJSPBean) _JSPBeans.get(p_pageCode);
^
3 errors
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure AbstractJSPBean is on your classpath when you compile.
Moving this to Java in general (Beginner)...
 
Jim Crawford
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah! you called me a beginner.
spelling mistake.
i'm just human you know!
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not calling you a beginner. The question just had nothing to do with the SCJP certification. I guess this forum is the most appropriate one for this type of question.
No hard feelings
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In relatively simple "circular relationships" between source files, Sun's recent compilers would seem to not have much trouble. For instance, this example compiles fine when the compiler can locate both source files.I once had a seemingly more complex "circular relationship" between many different source files and could not convince the compiler to compile it all at once. I got around the problem by creating a temporary definition of one of the "in between" classes that broke the circle and compiling everything. Then I used the correctly compiled classes to recompile the altered "in between" class using its proper definition.
That was not an ideal solution, but it worked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic