On Fri, Jul 1, 2011 at 1:17 PM, Thomas Bitterman <tbit...@osc.edu> wrote: > I have three files, all in the same directory: > > DistContainer6.x10: > import x10.compiler.Native; > public class DistContainer6 { > public static def main(args:Array[String](1)) { > Console.OUT.println("DistContainer6 test: Starting"); > val test = new HelloWrapper(); > Console.OUT.println("DistContainer6 test: Complete"); > } > } > > HelloWrapper.x10: > import x10.compiler.NativeClass; > @NativeClass("java", "", "JavaHello") > public class HelloWrapper { > public native def this(); > } > > JavaHello.java: > public class JavaHello { > public JavaHello() { > // this space intentionally left blank > } > > > public void sayHello() { > System.out.print("hello from JavaHello"); > } > } > > Attempting to compile DistContainer6.x10 results in: > > x10c: ---------- > 1. ERROR in > /nfs/17/tbitter/GAStuff/mcsweeny/examples/DistContainer6/HelloWrapper.java > (at line 17) > public JavaHello > ^^^^^^^^^ > JavaHello cannot be resolved to a type > ---------- > 2. ERROR in > /nfs/17/tbitter/GAStuff/mcsweeny/examples/DistContainer6/HelloWrapper.java > (at line 23) > public static HelloWrapper $make(final JavaHello id0){return new > HelloWrapper(id0);} > ^^^^^^^^^ > JavaHello cannot be resolved to a type > ---------- > 3. ERROR in > /nfs/17/tbitter/GAStuff/mcsweeny/examples/DistContainer6/HelloWrapper.java > (at line 24) > public HelloWrapper(final JavaHello id0) {super(); > ^^^^^^^^^ > JavaHello cannot be resolved to a type > ---------- > 4. ERROR in > /nfs/17/tbitter/GAStuff/mcsweeny/examples/DistContainer6/HelloWrapper.java > (at line 28) > this.__NATIVE_FIELD__ = id0; > ^^^^^^^^^^^^^^^^^^^^^ > JavaHello cannot be resolved to a type > ---------- > 5. ERROR in > /nfs/17/tbitter/GAStuff/mcsweeny/examples/DistContainer6/HelloWrapper.java > (at line 39) > this.__NATIVE_FIELD__ = new > JavaHello((java.lang.System[])null).$init(); > ^^^^^^^^^^^^^^^^^^^^^ > JavaHello cannot be resolved to a type > ---------- > 6. ERROR in > /nfs/17/tbitter/GAStuff/mcsweeny/examples/DistContainer6/HelloWrapper.java > (at line 39) > this.__NATIVE_FIELD__ = new > JavaHello((java.lang.System[])null).$init(); > ^^^^^^^^^ > JavaHello cannot be resolved to a type > ---------- > 6 problems (6 errors) > x10c: Non-zero return code: 255 > 2 errors. > > And also, JavaHello.java is blanked out. That is, the file is now empty. > > Things I have tried: > - changing the @NativeClass line to: @NativeClass("java", > "java.util.concurrent.locks", "ReentrantLock") fixes all errors. > - creating a JavaHello object and calling sayHello from a @Native annotation > in DistContainer6 works > > Any ideas?
Hi, Thomas, Apparently we are not doing such a great job tracking dependencies of generated files on Java classes. This is a bug and probably deserves a JIRA so that we don't lose track of it. Examining the code for post-compiling generated Java files confirms my suspicion that we are not constructing a sourcepath for the javac compiler at all -- only the classpath. When you open the JIRA, please include a request that an appropriate sourcepath is constructed. Your output indicates that you're invoking x10c from elsewhere. As a temporary workaround, try running x10c from the source directory -- that should pick up the Java files in the same directory, as javac puts "." on the sourcepath by default. Hope this helps, Igor ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users