Note that there are some explanatory texts on larger screens.

plurals
  1. POJavac fails to compile inner class with an inner class but works when the class is moved to its own code file - why?
    primarykey
    data
    text
    <p>I have encountered a peculiar build situation where a java project compiles in eclipse but fails on the build machine (Ant 1.8.2 with JDK 1.6)</p> <p>The compile fails on a class called 'DestinationList', which is an inner class with an inner class. Structure is similar to below.</p> <pre><code>public class MappingDetail { public class DestinationList extends AbstractGrowingScrollTable { public class DestinationListRow { } } } </code></pre> <p>With the classes laid out as above, the compilation fails complaining it cannot find 'AbstractGrowingScrollTable'. If I remove the inner-inner class 'DestinationListRow' the compile succeeds. If I move 'DestinationList' to its own code file compilation also succeeds.</p> <p>What is going on here? Since I have a work-around I ask out of interest. I cannot understand why this would fail.</p> <p>'AbstractGrowableScrollTable' is in a separate jar, but this jar is definitely on the classpath and in fact with verbose logging turned on I can see the class is actually found by javac shortly after. Excerpt below. Note on the last list of the log it does load AbstractGrowableScrollTable.</p> <pre><code>[javac] C:\Work\Decisiv\BUILD_AREA\code\source\APEI01\com\initech\sd\ap\ei01\ui\MappingDetail.java:551: cannot find symbol [javac] symbol : class AbstractGrowingScrollTable [javac] location: class com.initech.sd.ap.ei01.ui.MappingDetail [javac] public class DestinationList extends AbstractGrowingScrollTable { [javac] ^ [javac] [loading com\initech\sd\ks\ta01\resource\IResourceable.class(com\initech\sd\ks\ta01\resource:IResourceable.class)] [javac] [loading com\initech\sd\za\rt01\resources\Resources.class(com\initech\sd\za\rt01\resources:Resources.class)] [javac] [loading com\initech\sd\za\sh01\shared\Pair.class(com\initech\sd\za\sh01\shared:Pair.class)] [javac] [loading com\initech\sd\za\ui\component\CheckBox.class(com\initech\sd\za\ui\component:CheckBox.class)] [javac] [loading com\initech\sd\za\ui\component\Grid.class(com\initech\sd\za\ui\component:Grid.class)] [javac] [loading com\initech\sd\za\ui\component\Image.class(com\initech\sd\za\ui\component:Image.class)] [javac] [loading com\initech\sd\za\ui\component\Label.class(com\initech\sd\za\ui\component:Label.class)] [javac] [loading com\initech\sd\za\ui\component\Row.class(com\initech\sd\za\ui\component:Row.class)] [javac] [loading com\initech\sd\za\ui\component\layoutdata\GridLayoutData.class(com\initech\sd\za\ui\component\layoutdata:GridLayoutData.class)] [javac] [loading com\initech\sd\za\ui\component\layoutdata\RowLayoutData.class(com\initech\sd\za\ui\component\layoutdata:RowLayoutData.class)] [javac] [loading com\initech\sd\za\ui\component\properties\Alignment.class(com\initech\sd\za\ui\component\properties:Alignment.class)] [javac] [loading com\initech\sd\za\ui\component\properties\Font.class(com\initech\sd\za\ui\component\properties:Font.class)] [javac] [loading com\initech\sd\za\ui\component\table\ScrollTableColumn.class(com\initech\sd\za\ui\component\table:ScrollTableColumn.class)] [javac] [loading com\initech\sd\za\ui\component\table\ScrollTableRow.class(com\initech\sd\za\ui\component\table:ScrollTableRow.class)] [javac] [loading com\initech\sd\za\ui\resource\DefaultStyle.class(com\initech\sd\za\ui\resource:DefaultStyle.class)] [javac] [loading com\initech\sd\za\ui\resource\ImageResources.class(com\initech\sd\za\ui\resource:ImageResources.class)] [javac] [loading com\initech\sd\ui\cf\AbstractGrowingScrollTable.class(com\initech\sd\ui\cf:AbstractGrowingScrollTable.class)] </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload