Packages and import for jcurses

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

Packages and import for jcurses

gpatrick
My platform in Linux and I've downloaded jcurses which has the class files in a path of jcurses/classes/jcurses after the extraction.  Then there are directories of event, system, tests, util, widgets which each contain class files.

I went into the jcurses/classes/jcurses directory and ran 'jar -cvf */*.class and then put the .jar file into my CLASSPATH, but inside a jc.nrx:

import system.CharColor

Returns:
# nrc /tmp/jc.nrx
NetRexx portable processor, version NetRexx 3.02, build 172-20130625-1742
Copyright (c) RexxLA, 2011,2013.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program jc.nrx
   +++ Error: Program contains no classes
Compilation of 'jc.nrx' failed [one error]

And if I put in jc.nrx:
import jcurses.system.CharColor

It returns:
# nrc /tmp/jc.nrx
NetRexx portable processor, version NetRexx 3.02, build 172-20130625-1742
Copyright (c) RexxLA, 2011,2013.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program jc.nrx
 2 +++ import jcurses.system.CharColor
   +++        ^^^^^^^
   +++ Error: The class 'jcurses.system.CharColor' could not be found for import
   +++ Error: Program contains no classes
Compilation of 'jc.nrx' failed [2 errors]
 
What do I need to do to create a jar file or what do I do in the CLASSPATH so I can use jcurses?
Reply | Threaded
Open this post in threaded view
|

Re: Packages and import for jcurses

Marc Remes-2
My comments inline

On 09/24/2013 02:29 PM, gpatrick wrote:

> My platform in Linux and I've downloaded jcurses which has the class files in
> a path of jcurses/classes/jcurses after the extraction.  Then there are
> directories of event, system, tests, util, widgets which each contain class
> files.
>
> I went into the jcurses/classes/jcurses directory and ran 'jar -cvf
> */*.class and then put the .jar file into my CLASSPATH, but inside a jc.nrx:
>
> import system.CharColor
>
> Returns:
> # nrc /tmp/jc.nrx
> NetRexx portable processor, version NetRexx 3.02, build 172-20130625-1742
> Copyright (c) RexxLA, 2011,2013.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program jc.nrx
>     +++ Error: Program contains no classes
> Compilation of 'jc.nrx' failed [one error]

The no classes error is normal, there actually is nothing to run.
If you add some statement :

import system.CharColor

say "Hello world"

Then the compiler announces :
error: File jcurses.jar(system/CharColor.class) does not contain type system.CharColor as expected, but type
jcurses.system.CharColor. Please remove the file, or make sure it appears in the correct subdirectory of the class path.
/home/xx/src/nrj/jc.java:1: Class system.CharColor not found in import.
/* Generated from 'jc.nrx' 25 Sep 2013 12:13:06 [v3.00] *//* Options: Crossref Decimal Java Logo Trace2 Verbose3
*/import system.CharColor;
                                                                                                                           ^
2 errors
Compilation of 'jc.nrx' failed [javac failed]

Thus, you need to jar the class files from the jcurses directory (jar cvf jcurses/*/*class)
and code

import jcurses.system.CharColor
say "Hello world"


All this, because the original java file has the following package statement:

package jcurses.system;
..
public class CharColor {

You have to respect directory structure, even in the jar.


>
> And if I put in jc.nrx:
> import jcurses.system.CharColor
>
> It returns:
> # nrc /tmp/jc.nrx
> NetRexx portable processor, version NetRexx 3.02, build 172-20130625-1742
> Copyright (c) RexxLA, 2011,2013.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program jc.nrx
>   2 +++ import jcurses.system.CharColor
>     +++        ^^^^^^^
>     +++ Error: The class 'jcurses.system.CharColor' could not be found for
> import
>     +++ Error: Program contains no classes
> Compilation of 'jc.nrx' failed [2 errors]
>
> What do I need to do to create a jar file or what do I do in the CLASSPATH
> so I can use jcurses?
>
>
>
> --
> View this message in context: http://ibm-netrexx.215625.n3.nabble.com/Packages-and-import-for-jcurses-tp4026776.html
> Sent from the ibm-netrexx mailing list archive at Nabble.com.
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
>


--

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: Packages and import for jcurses

gpatrick
Thank you!