[Deutsch] [Bottom of Page] [MN Home Page] [MN Watcom Page]

MN Watcom Tip Page



JNI with Watcom


The following is a step-by-step description to create a Dynamic Link Library (DLL) for the Java Native Interface (JNI) using Watcom. It refers to the 'Hello World!' sample from Sun Microsystems Java Tutorial. To follow the steps beginning with 'Create a Shared Library' it is nesseccary to:

All files mentioned are available as a ZIP-Archive you can dowload (You have to change the JDK path in the makefile to fit with your system). The sample was created and tested with the following configurations:

Operating System: OS/2 Warp 4 (R9.023) and Windows 95 (OSR 2.1)
Compiler: Watcom 11.0b
JDK: 1.1.6 (OS/2, IBM) and 1.2.1 (Win32, Sun)

This description assumes that you are familiar with creating DLLs and with makefiles for the operating system or at least that you have an idea what this is all about. A corrupt DLL may hang your system what may result in loss of data. You follow this description at your own risk.

The following people gave me important hints and help:

Thank you.

[Content] [Top of Introduction]

Java syntax highlighting for VIW


The following is a step-by-step introduction to enable Java syntax highlighting for the Watcom Windows® NT Editor (%WATCOM%\BINNT\VIW.EXE, where %WATCOM% is the directory you installed the Watcom software). This only works with version 11.0b and contains three steps:

Please read the 'Known problems' section and report new problems or better solutions to the Watcom newsgroup.

This is unsupported and undocumented and comes to you with absolutely no warranty. After you made the modifications test the editor with various files and see if it works. If it doesn't work: Undo the modifications with the backup that was made during this introduction.

Known problems

Reported By: M. Neifer
Reported On: 05/10/1999
Status: FIXED
Description: If you uncheck syntax highlighting or change the language in the 'File Specific Options' dialog box you'll lost the ability for Java syntax highlighting.
Fix: Don't worry. Your options aren't lost. You have to edit 'weditor.ini' again. Go to the 'filetypesource *.java' section and reenter the selected digit for Java. When you restart VIW everthing is fine again (or should be :-).
Reported By: Axel Schmitz-Tewes
Reported On: 05/12/1999
Status: FIXED
Description: Make sure you modify the right 'weditor.ini'. Under Windows® NT you have to change the file in %systemroot% and not the one in %WATCOM%\EDDAT.
[Content] [Top of Introduction]

GNU CVS with Watcom

You could use the Concurrent Versions System GNU CVS together with Watcom. To do so you have to do the following:

  1. If you have not done so already, install GNU CVS and make sure that the file 'CVS.EXE' can be found within the PATH statement.
  2. Edit the batch file '%watcom%\binw\gen_ci.bat' (this file is called from the IDE to checkin files) so that it looks like this:
    @echo **********************************************************************
    @echo This is %WATCOM%\binw\gen_ci.bat.
    @echo You can edit this batchfile to provide checkin ( and unlock )
    @echo functionality to any generic revision control system.
    @echo **********************************************************************
    @rem   From IDE: Name=%1, File Containing Message=%2, Project=%3, Target=%4
    cvs -r commit -F %2 %1
  3. Edit the batch file '%watcom%\binw\gen_co.bat' (this file is called from the IDE to checkout files) so that it looks like this:
    @echo **********************************************************************
    @echo This is %WATCOM%\binw\gen_co.bat.
    @echo YOU can edit this batchfile to provide checkout ( and lock )
    @echo functionality to any generic revision control system.
    @echo **********************************************************************
    @rem   From IDE: pause=%1, name=%2, project=%3, target=%4
    @rem   Note: This is also called from the Editor,
    @rem         in which case the only parameter is the name (%1)
    cvs edit %2
    if [%1]==[no_pause] goto done
  4. If you haven't already worked with CVS please read the documentation!

Python with Watcom

Using the OS/2 IDE it seems that it's not possible to automatically use relative path names in targets (as it's possible in Windows). The file selector only reports full path names to the 'Add Source' dialog and you have to change everything by hand.

To make that less painful Stefan Schwarzer provides his smart Python tool 'mvsource'. It can automatically change path names in target files. Please try it.

If you don't have Python/2 (Python for OS/2) yet you can download it for free from Jeff Rush's Python Pages.

[Deutsch] [Top of Page] [Content] [MN Home Page] [MN Watcom Page]