Hi Igor,

As I explained before, I'm using a Maven-like directory layout.
So, basically I have classes in two trees:
         .../src/main/x10  and .../src/test/x10.

The x10c++ command below works fine and produces an executable as expected:


x10c++ -o test -MAIN_CLASS=com.jquantlib.math.statistics.StatisticsTests /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/math/statistics/BulkStatistics.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/math/statistics/RescaledRange.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/Platform.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/Constants.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/lang/annotations/Override.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/lang/annotations/ReadOnly.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/Defines.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/test/x10/com/jquantlib/math/statistics/RescaledRangeTests.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/test/x10/com/jquantlib/math/statistics/StatisticsTests.x10



I've create a Python script which basically is intended to make my life easier (supposing some day it will work!).
It's attached to this email.

It basically receives as argument the location where binaries will be produced and also a list of sourcepaths. The script retrieves all .x10 files from sourcepaths and concatenates some other parameters I've discovered from X10DT, when it emits the command line in the X10 Console. I had a look at x10 script and I couldnt figure out what I'm doing wrong.

So, in the end I'm trying to run the following command:
(I've added some newlines to make it more readable)


x10 -classpath /opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/javaws.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/charsets.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/deploy.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/jce.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/rt.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/management-agent.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/alt-rt.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/jsse.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/plugin.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/resources.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/security/US_export_policy.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/security/local_policy.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/ext/localedata.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/ext/sunjce_provider.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/ext/sunpkcs11.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/ext/dnsns.jar:/opt/Ja vaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/im/indicim.jar:/opt/JavaIDE/jdk1.6.0_21-linux-x86_64/jre/lib/im/thaiim.jar:/opt/JavaIDE/eclipse-x10dt-helios-linux-gtk-x86_64/plugins/x10.common_2.1.0.201010261354.jar:/opt/JavaIDE/eclipse-x10dt-helios-linux-gtk-x86_64/plugins/x10.runtime_2.1.0.201010261354.jar:/opt/JavaIDE/eclipse-x10dt-helios-linux-gtk-x86_64/plugins/x10.constraints_2.1.0.201010261354.jar/opt/JavaIDE/eclipse-x10dt-helios-linux-gtk-x86_64/plugins/x10.runtime_2.1.0.201010261354.jar:/home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10:/home/rgomes/developer/workspace-x10/xql-statistics/src/test/x10:

-d /home/rgomes/developer/workspace-x10/xql-statistics/target-assert

-commandlineonly
-ox java
-errors 100
-w 80
-noserial
-LOOP_OPTIMIZATIONS
-CLOSURE_INLINING
-PLUGINS=""
-PLUGIN_COMPILER=""

com.jquantlib.math.statistics.StatisticsTests

/home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/Platform.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/Constants.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/Defines.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/math/statistics/BulkStatistics.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/math/statistics/RescaledRange.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/lang/annotations/Override.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10/com/jquantlib/lang/annotations/ReadOnly.x10/home/rgomes/developer/workspace-x10/xql-statistics/src/test/x10/com/jquantlib/math/statistics/RescaledRangeTests.x10 /home/rgomes/developer/workspace-x10/xql-statistics/src/test/x10/com/jquantlib/math/statistics/StatisticsTests.x10



The error message is:

Caused by: java.lang.ClassNotFoundException: .opt.JavaIDE.eclipse-x10dt-helios-linux-gtk-x86_64.plugins.x10.runtime_2.1.0.201010261354.jar:.home.rgomes.developer.workspace-x10.xql-statistics.src.main.x10:.home.rgomes.developer.workspace-x10.xql-statistics.src.test.x10$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)
Could not find the main class: /opt/JavaIDE/eclipse-x10dt-helios-linux-gtk-x86_64/plugins/x10.runtime_2.1.0.201010261354.jar:/home/rgomes/developer/workspace-x10/xql-statistics/src/main/x10:/home/rgomes/developer/workspace-x10/xql-statistics/src/test/x10$Main. Program will exit.


Thanks a lot :)


-- Richard Gomes



On 05/11/10 16:01, Igor Peshansky wrote:
Richard Gomes<rgomes1...@yahoo.co.uk>  wrote on 11/05/2010 10:40:21 AM:

Hi Igor,

I'm also trying the Java compiler but it fails like this:

$ x10 \
      com.jquantlib.math.statistics.StatisticsTests
      `find ~/workspace-x10/xql-statistics/src/main/x10 \
            -type f -name '*.x10' `  \
      `find ~/workspace-x10/xql-statistics/src/test/x10 \
            -type f -name '*.x10' `

Exception in thread "main" java.lang.NoClassDefFoundError:
com/jquantlib/math/statistics/StatisticsTests$Main
Caused by: java.lang.ClassNotFoundException:
com.jquantlib.math.statistics.StatisticsTests$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)
Could not find the main class:
com.jquantlib.math.statistics.StatisticsTests$Main.  Program will exit.


Yeah... I'm sure I have a main method there:



public class StatisticsTests {

          public static def main(r: Array[String]{self.rank==1}):void {
                  val o = new StatisticsTests();
                  o.testAll();
          }



I've also tried a variation of that command, specifying "-classpath" and

passing relative file names, more or less like exemplified below:


$ x10 \
      -classpath /home/rgomes/proj/main/x10:/home/rgomes/proj/test/x10 \
      testpkg.MyTestClass \
          srcpkg/A.x10 srcpkg/B.x10 \
          testpkg/MyTestClass.x10 testpkg/SomeOtherClass.x10


What am I doing wrong?

Hi, Richard,

I suspect the classpath is not set up correctly, but to give you
the right incantation, I need to know what your compilation command
(x10c) looked like.

Here's something that I use all the time:

x10c -d out a/b/Foo.x10
x10 -cp out a.b.Foo

Hope this helps,
         Igor
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to