Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

kenner

But: Standard java classpath is not understood in java-6-openjdk installed on Angstrom on a Beaglebone Black (BBB)

 

 

19:42:13 Mon Jun 24 kensbone 527 /netrexx/examples/rosettacode --> echo $CLASSPATH
/netrexx/lib/NetRexxC.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar
19:43:27 Mon Jun 24 kensbone 528 /netrexx/examples/rosettacode --> ls -l /netrexx/lib/
total 4296
-rw-r--r-- 1 root root  394113 Jun 24 19:20 NetRexxC.jar
-rw-r--r-- 1 root root 2200813 Jun 24 19:20 NetRexxF.jar
-rw-r--r-- 1 root root 1796149 Jun 24 19:20 ecj-4.2.jar
19:43:56 Mon Jun 24 kensbone 529 /netrexx/examples/rosettacode --> java -classpath . HelloWorld
Exception in thread "main" java.lang.NoClassDefFoundError: netrexx/lang/RexxIO
    at HelloWorld.main(HelloWorld.nrx:2)
Caused by: java.lang.ClassNotFoundException: netrexx.lang.RexxIO
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
    ... 1 more
19:44:20 Mon Jun 24 kensbone 530 /netrexx/examples/rosettacode --> java -classpath .:/netrexx/lib/NetRexxC.jar HelloWorld
Goodbye, World!
19:45:10 Mon Jun 24 kensbone 531 /netrexx/examples/rosettacode --> echo $CLASSPATH
/netrexx/lib/NetRexxC.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

Tom Maynard
On 25-Jun-13 07:23, Kenneth Klein (TEMA TPC) wrote:

But: Standard java classpath is not understood in java-6-openjdk installed on Angstrom on a Beaglebone Black (BBB)

 

 

19:42:13 Mon Jun 24 kensbone 527 /netrexx/examples/rosettacode --> echo $CLASSPATH
/netrexx/lib/NetRexxC.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar


I don't see "." in your classpath here, but you take the time to state it explicitly when you do it by hand:

19:44:20 Mon Jun 24 kensbone 530 /netrexx/examples/rosettacode --> java -classpath .:/netrexx/lib/NetRexxC.jar HelloWorld
Goodbye, World!


Is there a reason for that?  And what happens when you do include it in your CLASSPATH declaration?

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

rvjansen
In reply to this post by kenner
<base href="x-msg://5510/">Hi Ken,

I think this is OK; with the java -classpath option you are un-setting the previous classpath. So this works as designed I'm afraid.

best regards,

René.

On 25 jun. 2013, at 14:23, "Kenneth Klein (TEMA TPC)" <[hidden email]> wrote:

But: Standard java classpath is not understood in java-6-openjdk installed on Angstrom on a Beaglebone Black (BBB)
 
 
19:42:13 Mon Jun 24 kensbone 527 /netrexx/examples/rosettacode --> echo $CLASSPATH
/netrexx/lib/NetRexxC.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar
19:43:27 Mon Jun 24 kensbone 528 /netrexx/examples/rosettacode --> ls -l /netrexx/lib/
total 4296
-rw-r--r-- 1 root root  394113 Jun 24 19:20 NetRexxC.jar
-rw-r--r-- 1 root root 2200813 Jun 24 19:20 NetRexxF.jar
-rw-r--r-- 1 root root 1796149 Jun 24 19:20 ecj-4.2.jar
19:43:56 Mon Jun 24 kensbone 529 /netrexx/examples/rosettacode --> java -classpath . HelloWorld 
Exception in thread "main" java.lang.NoClassDefFoundError: netrexx/lang/RexxIO
    at HelloWorld.main(HelloWorld.nrx:2)
Caused by: java.lang.ClassNotFoundException: netrexx.lang.RexxIO
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
    ... 1 more
19:44:20 Mon Jun 24 kensbone 530 /netrexx/examples/rosettacode --> java -classpath .:/netrexx/lib/NetRexxC.jar HelloWorld 
Goodbye, World!
19:45:10 Mon Jun 24 kensbone 531 /netrexx/examples/rosettacode --> echo $CLASSPATH
/netrexx/lib/NetRexxC.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar
_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

kenner
In reply to this post by Tom Maynard

Good catch, Tom. I will test with a dot in the defined CLASSPATH (which I think is useless as only .jar files are found in a CLASSPATH) and without the dot on the JAVA command line. – when I get home.

 

Rene, I am hoping there is a way to specify a proper CLASSPATH environment variable and not have to spell it out on the command line all the time.

I will probably go forward with testing Ubuntu as I have heard good things about it.

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Maynard
Sent: Tuesday, June 25, 2013 8:32 AM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

 

On 25-Jun-13 07:23, Kenneth Klein (TEMA TPC) wrote:

But: Standard java classpath is not understood in java-6-openjdk installed on Angstrom on a Beaglebone Black (BBB)

 

 

19:42:13 Mon Jun 24 kensbone 527 /netrexx/examples/rosettacode --> echo $CLASSPATH
/netrexx/lib/NetRexxC.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar


I don't see "." in your classpath here, but you take the time to state it explicitly when you do it by hand:


19:44:20 Mon Jun 24 kensbone 530 /netrexx/examples/rosettacode --> java -classpath .:/netrexx/lib/NetRexxC.jar HelloWorld
Goodbye, World!


Is there a reason for that?  And what happens when you do include it in your CLASSPATH declaration?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

Marc Remes-2
On 06/25/2013 03:24 PM, Kenneth Klein (TEMA TPC) wrote:
> CLASSPATH (which I think is useless as only .jar files are found in a CLASSPATH)

Perhaps you misinterpret classpath.
Classpath directs the finding of classes, not jar files.
If you put a directory, the jre will find all .class files in the specified directory, if you put a .jar file, it will
find all .class files in the jar.
It will not find all .class files inside .jar files found on classpath.

BTW, java6 and above support wildcards for .jars : "java -classpath '.:/mylib/*' MyApp" will load all classes from the
current directory AND ALL classes found in jars located in /mylib


--

Marc

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

kenner
Thank you, Marc. I've been fumbling with that misunderstanding for  years.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Marc Remes
Sent: Tuesday, June 25, 2013 3:22 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] Netrexx example code "HellowWorld.nrx" compiled and run on a BBB

On 06/25/2013 03:24 PM, Kenneth Klein (TEMA TPC) wrote:
> CLASSPATH (which I think is useless as only .jar files are found in a
> CLASSPATH)

Perhaps you misinterpret classpath.
Classpath directs the finding of classes, not jar files.
If you put a directory, the jre will find all .class files in the specified directory, if you put a .jar file, it will find all .class files in the jar.
It will not find all .class files inside .jar files found on classpath.

BTW, java6 and above support wildcards for .jars : "java -classpath '.:/mylib/*' MyApp" will load all classes from the current directory AND ALL classes found in jars located in /mylib


--

Marc

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/