From: Colin <net...@im...> - 2021-11-01 04:13:32
|
Thanks Rene I guess I must have something set up incorrectly in my environment. z:\NetRexx-4.01-GA\bin> z:\NetRexx-4.01-GA\bin>dir testpipe* Volume in drive Z is OS Volume Serial Number is 643B-12E5 Directory of z:\NetRexx-4.01-GA\bin 2021-10-28 05:23 PM 334 testpipe.njp 1 File(s) 334 bytes 0 Dir(s) 1,035,456,036,864 bytes free z:\NetRexx-4.01-GA\bin>pipc testpipe.njp pipe (testpipe_apipe stall 1000 ) stem F | sort | prefix literal arg(string 'avar'} | console | stem T z:\NetRexx-4.01-GA\bin>dir testpipe* Volume in drive Z is OS Volume Serial Number is 643B-12E5 Directory of z:\NetRexx-4.01-GA\bin 2021-10-31 07:32 PM 1,845 testpipe.class 2021-10-28 05:23 PM 334 testpipe.njp 2021-10-31 07:32 PM 4,180 testpipe_apipe.class 2021-10-31 07:32 PM 314 testpipe_apipe_sortRexx_2.class 4 File(s) 6,673 bytes 0 Dir(s) 1,035,455,619,072 bytes free z:\NetRexx-4.01-GA\bin>java testpipe 10 Error: Unable to initialize main class testpipe Caused by: java.lang.NoClassDefFoundError: org/netrexx/njpipes/pipes/ThreadQ *z:\NetRexx-4.01-GA\bin*>java testpipe Error: Unable to initialize main class testpipe Caused by: java.lang.NoClassDefFoundError: org/netrexx/njpipes/pipes/ThreadQ z:\NetRexx-4.01-GA\bin>java testpipe_apipe Error: Could not find or load main class testpipe_apipe Caused by: java.lang.NoClassDefFoundError: org/netrexx/njpipes/pipes/pipe z:\NetRexx-4.01-GA\bin>set | find "CLASSPATH" CLASSPATH=Z:\NetRexx-4.01-GA\lib\jansi-1.18.jar;*Z:\NetRexx-4.01-GA\bi**n*;Z:\NetRexx-4.01-GA\build\lib\*; I wonder if it is because I am using Microsoft OpenJDK implementation. z:\NetRexx-4.01-GA\bin>java -version openjdk version "11.0.10" 2021-01-19 OpenJDK Runtime Environment Microsoft-18724 (build 11.0.10+9) OpenJDK 64-Bit Server VM Microsoft-18724 (build 11.0.10+9, mixed mode) In fact this may indeed be the problem. z:\NetRexx-4.01-GA\bin>nrc hello java -cp "Z:\NetRexx-4.01-GA\lib\jansi-1.18.jar;Z:\NetRexx-4.01-GA\bin;Z:\NetRexx-4.01-GA\build\lib\*;;;z:\NetRexx-4.01-GA\lib\NetRexxF.jar;." -Dnrx.compiler=ecj org.netrexx.process.NetRexxC hello NetRexx portable processor 4.01-GA build 573-20210320-2000 Copyright (c) RexxLA, 2011,2021. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program hello.nrx Compilation of 'hello.nrx' successful z:\NetRexx-4.01-GA\bin>java hello Exception in thread "main" java.lang.NoClassDefFoundError: netrexx/lang/RexxIO at hello.main(hello.java:2) Caused by: java.lang.ClassNotFoundException: netrexx.lang.RexxIO at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 1 more I thought I had tried this before. . .something has mucked up my environment. I also cannot find any detailed description of callpipe and addpipe. They just magically appear in some of the examples with no prior explanation. I will look at rebuilding my environment from scratch with a different JDK to see if that helps. Thanks again for your help. Cheers Colin On 2021-10-31 06:39, René Jansen wrote: > I wish I had an ‘unsound’ button. > > No, SORT is right. > > In this case, as remarked in the source, you have to run java testpipe > - works here. > > René. > >> On 31 Oct 2021, at 14:36, René Jansen <rvj...@xs...> wrote: >> >> Hi Colin, >> >> The only thing is, you cannot specify a .class extension after a >> filename when invoking java through the java.exe processor. This is >> outside of our control. >> >> Interestingly, I just ran the class, and the example uncovers an >> error in the sort stage, or so it seems. Just in time for NetRexx >> 4.0.2 - and your examples prompted a documentation change, there was >> too much left implicit. >> >> Best regards, >> >> René. >> >> >>> On 31 Oct 2021, at 06:49, Colin <net...@im...> wrote: >>> >>> Thanks Rene >>> >>> I am still a little confused though. >>> >>> I have a file called testpipe.nrx which has been copied from the >>> Pipelines Quick Start manual >>> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin>dir testpipe* >>> Volume in drive Z is OS >>> Volume Serial Number is 643B-12E5 >>> >>> Directory of z:\NetRexx-4.01-GA\bin >>> >>> 2021-10-28 05:23 PM 334 testpipe.nrx >>> 1 File(s) 334 bytes >>> 0 Dir(s) 1,038,705,549,312 bytes free >>> >>> z:\NetRexx-4.01-GA\bin>type testpipe.nrx >>> class testpipe >>> >>> method testpipe(avar=Rexx) >>> >>> F = Rexx 'abase' >>> T = Rexx 1 >>> >>> F[0]=5 >>> F[1]=222 >>> F[2]=3333 >>> F[3]=1111 >>> F[4]=55 >>> F[5]=444 >>> >>> pipe (apipe stall 1000 ) >>> stem F | sort | prefix literal {avar} | console | stem T >>> >>> loop i=1 to T[0] >>> say 'T['i']='T[i] >>> end >>> >>> method main(a=String[]) static >>> >>> testpipe(Rexx(a)) >>> z:\NetRexx-4.01-GA\bin> >>> >>> >>> My understanding is that I am supposed to use pipc to compile it. >>> >>> >>> z:\NetRexx-4.01-GA\bin>pipc testpipe >>> 16 +++ stem F | sort | prefix literal {avar} | console | stem T >>> +++ ^ >>> +++ Error: Unexpected character found in source: '{' >>> (hexadecimal encoding: 007B) >>> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin>dir testpipe* >>> Volume in drive Z is OS >>> Volume Serial Number is 643B-12E5 >>> >>> Directory of z:\NetRexx-4.01-GA\bin >>> >>> 2021-10-28 05:23 PM 334 testpipe.nrx >>> 1 File(s) 334 bytes >>> 0 Dir(s) 1,038,709,510,144 bytes free >>> >>> >>> Hmmm.. . . maybe I am supposed to call it testpipe.njp. Let's >>> rename it. >>> >>> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin>rename testpipe.nrx testpipe.njp >>> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin>dir testpipe* >>> Volume in drive Z is OS >>> Volume Serial Number is 643B-12E5 >>> >>> Directory of z:\NetRexx-4.01-GA\bin >>> >>> 2021-10-28 05:23 PM 334 testpipe.njp >>> 1 File(s) 334 bytes >>> 0 Dir(s) 1,038,709,354,496 bytes free >>> >>> z:\NetRexx-4.01-GA\bin>pipc testpipe >>> pipe (testpipe_apipe stall 1000 ) stem F | sort | prefix literal >>> arg(string 'avar'} | console | stem T >>> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin>dir testpipe* >>> Volume in drive Z is OS >>> Volume Serial Number is 643B-12E5 >>> >>> Directory of z:\NetRexx-4.01-GA\bin >>> >>> 2021-10-30 10:31 PM 1,845 testpipe.class >>> 2021-10-28 05:23 PM 334 testpipe.njp >>> 2021-10-30 10:31 PM 4,180 testpipe_apipe.class >>> 2021-10-30 10:31 PM 314 testpipe_apipe_sortRexx_2.class >>> 4 File(s) 6,673 bytes >>> 0 Dir(s) 1,038,709,751,808 bytes free >>> >>> >>> This looks much more promising. Let's run it. >>> >>> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin> >>> z:\NetRexx-4.01-GA\bin>java testpipe >>> Error: Unable to initialize main class testpipe >>> Caused by: java.lang.NoClassDefFoundError: >>> org/netrexx/njpipes/pipes/ThreadQ >>> >>> That didn't work so I wonder if I am supposed to execute the >>> testpipe_apipe.class instead. >>> >>> >>> z:\NetRexx-4.01-GA\bin>java testpipe_apipe.class >>> Error: Could not find or load main class testpipe_apipe.class >>> Caused by: java.lang.ClassNotFoundException: testpipe_apipe.class >>> >>> z:\NetRexx-4.01-GA\bin> >>> >>> >>> Not sure what I am doing wrong. >>> >>> Thanks >>> Colin >>> >>> >>> On 2021-10-30 07:23, René Jansen wrote: >>>> Hi Leslie, Colin, >>>> >>>> This source needs the pipes compiler - please try with pipc (pipc: aliased to java org.netrexx.njpipes.pipes.compiler) - it needs that step to sort out the variable inclusion. Colins analysis that the NetRexx compiler cannot handle this is correct. If you can include a version of the source that does not include | (pipes) at the start I can easier check that for you. >>>> >>>> Best regards, >>>> >>>> René. >>>> >>>> >>>>> On 28 Oct 2021, at 12:36, J Leslie Turriff<jlt...@ma...> wrote: >>>>> >>>>> I'm trying to use a simple pipeline in a NetRexx routine, but nrc doesn't like my >>>>> variable substitution: >>>>> >>>>> ~/bin/NetRexx >>>>> | $ echo $JAVA_HOME >>>>> | >>>>> | @05:27:11,leslie@pinto rc=0 >>>>> | ~/bin/NetRexx >>>>> | $ echo $CLASSPATH >>>>> | .:/home/leslie/bin/NetRexx/:/usr/java/jdk-17:/usr/local/NetRexx-4.01-GA/lib/NetRexxF.jar >>>>> | @05:27:21,leslie@pinto rc=0 >>>>> | ~/bin/NetRexx >>>>> | $ cat newTree.nrx >>>>> | -- .-----------------------------------------------------------------------. -- >>>>> | -- | Change Log | -- >>>>> | -- |Version Date Description | -- >>>>> | -- |------- ---------- ----------------------------------------------------| -- >>>>> | -- | | -- >>>>> | -- |1.0 2021-10-27 Creation | -- >>>>> | -- '-----------------------------------------------------------------------' -- >>>>> | import org.netrexx.njpipes.pipes. >>>>> | trace off >>>>> | parse arg treeBase >>>>> | treePipe(Rexx(treeBase)) >>>>> | exit 0 >>>>> | ------------------------------------------------------------------------------- >>>>> | method treePipe(treeArguments) >>>>> | pipe (fixTree) >>>>> | command /usr/bin/tree {treeArguments} >>>>> | | tree: split at /[/ >>>>> | | merge: specs select 1 1-* next >>>>> | select 0 1-* next >>>>> | select 2 1-* next >>>>> | | console >>>>> | ? tree: split at /]/ | attrs: >>>>> | ? attrs: | merge: >>>>> | --===========================================================================-- >>>>> | @05:27:31,leslie@pinto rc=0 >>>>> | ~/bin/NetRexx >>>>> | $ nrc newTree.nrx >>>>> | NetRexx portable processor 4.01-GA build 573-20210320-2000 >>>>> | Copyright (c) RexxLA, 2011,2021. All rights reserved. >>>>> | Parts Copyright (c) IBM Corporation, 1995,2008. >>>>> | Program newTree.nrx >>>>> | 16 +++ command /usr/bin/tree {treeArguments} >>>>> | +++ ^ >>>>> | +++ Error: Unexpected character found in source: '{' (hexadecimal encoding: 007B) >>>>> | Compilation of 'newTree.nrx' failed [one error] >>>>> | @05:27:40,leslie@pinto rc=2 >>>>> >>>>> I can't see what I'm doing differently to what is described in "How to use a pipe in a >>>>> NetRexx program", page 24 of "Pipelines Guide and Reference"; I tried first putting the >>>>> pipeline into the implicit main() method, then in a separate method; neither worked, so I >>>>> looked through the examples in the NetRexx package and noticed the import statement, but >>>>> adding that didn't help either. >>>>> What am I doing wrong? >>>>> >>>>> Leslie >>>>> -- >>>>> Distribution: openSUSE Leap 15.3 x86_64 >>>>> java version "17" 2021-09-14 LTS >>>>> Java(TM) SE Runtime Environment (build 17+35-LTS-2724) >>>>> Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing) >>>>> NetRexx portable processor 4.01-GA build 573-20210320-2000 >>>>> >>>>> >>>>> _______________________________________________ >>>>> netrexx-pipelines mailing list >>>>> net...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines >>>> _______________________________________________ >>>> netrexx-pipelines mailing list >>>> net...@li... >>>> https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines >>> >> > |