Minor Gordon/Watson/Contr/i...@ibmus wrote on 10/14/2010 09:22:20 AM:

> Hi all,
> 
> This is probably a known issue, but I don't see the problem yet. Why 
does 
> this code
> 
> class test {
>     public static def main( args : Rail[String] ) : Void {
>     }
> }
> 
> not produce a test$Main.class with the trunk x10c, which leads to
> 
> Exception in thread "main" java.lang.NoClassDefFoundError: test$Main
> Caused by: java.lang.ClassNotFoundException: test$Main
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> 
> when `x10 test` is run (again with trunk), while the same sequence works 

> with the last release? Has main's signature changed?

Yes, it has.  The new signature is

public static def main(Array[String]):void;

If you want to access the arguments inside the body of main, you may want
to also constrain the array to be of rank 1, e.g.:

public static def main(args:Array[String](1)):void { ... args(i) ... }

Hope this helps,
        Igor
-- 
Igor Peshansky  (note the spelling change!)
IBM T.J. Watson Research Center
X10: Parallel Productivity and Performance (http://x10-lang.org/)
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
"I hear and I forget.  I see and I remember.  I do and I understand" -- 
Confucius


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to