Dear list:

We know that our x10 program will be compiled to java program for running on
JVM when using java back-end.

For example, I write a simple "Hello World" program as Hello.x10. When I
compile Hello.x10, I get three generated java files - Hello.java,
Hello.class, Hello$$Main.class.

Now my question is that we can run x10 program with command "x10", but can
we run the program directly with its java files? For example, "java Hello".
I try this way, using -classpath to add x10 runtime jar, but the result is:

java -cp
/home/cheermc/Desktop/x10dt/plugins/x10.runtime_2.2.1.201109271452.jar Hello

Exception in thread "main" java.lang.NoClassDefFoundError: Hello

Caused by: java.lang.ClassNotFoundException: Hello

         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:306)

         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Could not find the main class: Hello.  Program will exit.

 

I find that it's different from normal java file because compiling a
Hello.java file will only generate a Hello.class file but no
Hello$$Main.class file. I wonder how the x10 program finally run on JVM with
java command. With the answer, we can integrate x10 program into java
program by using the binary-format file.

PS: I read Native Code Integration in x10 language specification, but it
seems not so helpful for me. 

 

Best regards.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, 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-novd2d
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to