Zip/JAR Files

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

Zip/JAR Files

J. Pedone
Perhaps somone here can clear up a mystery ?  I've been playing with
zipping up class files lately and have found (as it should) if the zip
is in the CLASSPATH, any java program that needs those classes will
find them.
  What has surprised me though, is that the java program will not
compile under netrexx unless the classes are outside of the zip file.

Specifically this java program:

-- xdt1.nrx
-- exercise all XDATE formats
--

kind = 'O U S J B C D M W I K L N X'
loop while kind <> ''
   parse kind item kind          
   date = xmisc.xdate('TODAY',item)
   say 'Format "'item'" is: 'date'.'
end                                  
exit 0

The function xmisc.xdate is part of the xmisc.class file contained in
xfiles.zip.  If I unzip the xfiles.zip file and compile xdt1.nrx from
the same directory as xmisc.class, everything is happy.  
If I run the resulting xdt1.class file from any directory after
deleting xmisc.class, java finds the class file in the zip just fine
and it runs with no problem.
Netrexx however, will not find xmisc.class unless it is unzipped and in
the current directory.  What gives ?


My class/lib stuff:

REM **************************************************************
REM           Java Support
REM **************************************************************
SET
CLASSPATH=c:\netscape\java11\jempcl10.zip;c:\netscape\njclass.zip;.;.\.;
C:\JAVA11\ICATJAVA\DAEMON\JAVAPROB.ZIP;c:\java11\lib\NetRexxC.zip;c:\net
rexx\x\xfiles.zip;
REM **************************************************************

REM *************************************************************
REM Added by java 1.1.6
REM *************************************************************
SET INCLUDE=C:\JAVA11\INCLUDE;C:\JAVA11\INCLUDE\OS2;
SET LIB=C:\JAVA11\LIB;c:\netrexx\x;
REM **************************************************************


[hidden email]                         (\         /)
http://www.flash.net/~jpedone        (\    -   /)
                                                       (\   ( )  /)
                                                       (/ <  > \)
                                                          (/\/\)
                                                          /    \
                                                        (        )
DOS never says "EXCELLENT command or filename"...
Don't hit the keys so hard, it hurts.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Client application in Netrexx

kikuti
Hi all,

In "Creating Java Applications Using NetRexx" there is :

NetRexx is the language for server programming (GUI programming might
       be easier with a visual programming tool).

Is it still true?
I plan to write an application for Accounts receivables in my office.
Will "VisualAge for Java" be better than using NetRexx?

kikuti

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Appending lines to a file

kikuti
Hi all,

In C, I could:
fopen(.......,"append",...)
write(..........)

In "Creating Java Applications Using NetRexx", I found following example
and tried.
 
The program overwrites data from the beginning of a file, and I would
like to know a way of opening a file with append mode.
(With RandomAccessFile , I can do the thing.)

kikuti


-----------------------------------------------------------------

Figure 99. Buffered Input and Print Output: LineIO.nrx

 /* file\LineIO.nrx

    Line-mode I/O using buffered reader and printer writer.
    Extract 'DEVICE' statements from a file (default CONFIG.SYS).  */

    parse arg filename
    if filename = '' then filename = 'C:/CONFIG.SYS'
    output = 'CONFIG.DEV'
    say 'File:' filename '->' output

    inFile  = FileReader(filename)                   -- input file
    source  = BufferedReader(inFile)                 -- buffered

    outFile = FileWriter(output)                     -- output file
    dest    = PrintWriter(outFile)                   -- to printer

    loop forever
       textline = source.readLine()                  -- read the file
       if textline = null then leave                 -- end-of-file ?
       parse textline word1 '=' .
       if word1 = "device" then do                   -- DEVICE statement
?
          dest.println(textline)                     -- write output
       end
    end

    source.close()                                   -- close files
    dest.close()

    say 'Extracted DEVICE statements:'               -- display results
    source = BufferedReader( FileReader(output) )    -- read output file
    loop until textline = null
        textline = source.readLine()
        if textline \= null then say ' ' textline    -- standard output
    end
 -- end LineIO

--------------------------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Appending lines to a file

kikuti
Hi again,

Sorry, I found:

----------------------------------------------------
 FileWriter

 public FileWriter(String fileName,
                   boolean append) throws IOException
--------------------------------------------------------------

This should help me.

kikuti



kikuchi wrote:

>
> Hi all,
>
> In C, I could:
> fopen(.......,"append",...)
> write(..........)
>
> In "Creating Java Applications Using NetRexx", I found following example
> and tried.
>
> The program overwrites data from the beginning of a file, and I would
> like to know a way of opening a file with append mode.
> (With RandomAccessFile , I can do the thing.)
>
> kikuti
>
> -----------------------------------------------------------------
>
> Figure 99. Buffered Input and Print Output: LineIO.nrx
>
>  /* file\LineIO.nrx
>
>     Line-mode I/O using buffered reader and printer writer.
>     Extract 'DEVICE' statements from a file (default CONFIG.SYS).  */
>
>     parse arg filename
>     if filename = '' then filename = 'C:/CONFIG.SYS'
>     output = 'CONFIG.DEV'
>     say 'File:' filename '->' output
>
>     inFile  = FileReader(filename)                   -- input file
>     source  = BufferedReader(inFile)                 -- buffered
>
>     outFile = FileWriter(output)                     -- output file
>     dest    = PrintWriter(outFile)                   -- to printer
>
>     loop forever
>        textline = source.readLine()                  -- read the file
>        if textline = null then leave                 -- end-of-file ?
>        parse textline word1 '=' .
>        if word1 = "device" then do                   -- DEVICE statement
> ?
>           dest.println(textline)                     -- write output
>        end
>     end
>
>     source.close()                                   -- close files
>     dest.close()
>
>     say 'Extracted DEVICE statements:'               -- display results
>     source = BufferedReader( FileReader(output) )    -- read output file
>     loop until textline = null
>         textline = source.readLine()
>         if textline \= null then say ' ' textline    -- standard output
>     end
>  -- end LineIO
>
> --------------------------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>