It's not a secret anymore!*
The moose likes Beginning Java and the fly likes Compile files that ref each other? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile files that ref each other?" Watch "Compile files that ref each other?" New topic
Author

Compile files that ref each other?

Jim Crawford
Ranch Hand

Joined: Sep 08, 2002
Posts: 127
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.


<img src="cool.gif" border="0"> <img src="graemlins/beerchug.gif" border="0" alt="[beerchug]" /> <br />SCJP 1.4
Jim Crawford
Ranch Hand

Joined: Sep 08, 2002
Posts: 127
..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

Joined: Aug 26, 2001
Posts: 7610
Make sure AbstractJSPBean is on your classpath when you compile.
Moving this to Java in general (Beginner)...


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Jim Crawford
Ranch Hand

Joined: Sep 08, 2002
Posts: 127
ah! you called me a beginner.
spelling mistake.
i'm just human you know!
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
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

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compile files that ref each other?