Nokia nmake Product Builder: Java Support


npwj - run Java command given UNIX® pathnames


npwj java_command [ parameters ]


The npwj (native path wrapper for Java ) converts UNIX format pathnames to Windows® format pathnames and calls the specified Java command with the converted pathnames. It is intended for use on a Windows host, and provides a convenient way to call Windows based Java commands from an environment using UNIX pathnames such as Interix or UWIN.

Nokia nmake calls npwj internally where appropriate; no special action or manual setup is required when using nmake's built-in rules. This manual page describes npwj for standalone use outside of nmake.

npwj does the following:

  1. Identifies the parameters that contain one or more UNIX absolute pathnames.
  2. Converts UNIX absolute pathnames to Windows equivalents (relative pathnames are not changed).
  3. Compiles a new command line, which begins with java_command and contains the converted Windows pathnames in parameters.
  4. Executes the new command line.

A parameter may contain a single pathname or a set of pathnames separated by ':'. A set of pathnames is first converted to a pathname array. For each UNIX absolute pathname, npwj calls the appropriate function (unixpath2win() in the case of Interix, uwin_path() in the case of UWIN) to convert the UNIX pathname to the corresponding Windows pathname. When a set of paths is re-constructed, ';' replaces ':' as the path separator character. Since ';' is a special character in the UNIX environment, it is re-written as "\;". Another special character '$', which is often used in Java class filenames, is also re-written as "\$".

npwj can be used for all Java commands including java, javac, jdeps and jar.


Here is a simple example using ksh on a UWIN platform:

$ npwj javac ~/tmp/

Since javac is a Windows-based command, attempting to directly pass a UNIX style pathname would have resulted in an error:

$ javac ~/tmp/                                              
error: cannot read: /home/na01/gms/tmp/
1 error

A ksh alias may be used to make javac invocation more convenient for interactive use:

$ alias jc='npwj javac'
$ jc ~/tmp/

Copyright 2004 Lucent Technologies Inc. Copyright 2007, 2008 Alcatel-Lucent Technologies Inc. All Rights Reserved.
See for terms of use.

npwj - run Java command given UNIX® pathnames
Release 10 @(#)npwjman.html 08/08/07