JNI with SDK 1.4

With SDK 1.4 it is not possible to get environment variables with System.getenv(String name), because this method is deprecated. This DLL implements the getenv method again, a method for getting the Windows platform id and a method for clearing the screen.

To create your own JNI project with SDK 1.4 and .DOT, first write the java class, compile it and create the JNI-header:

Then start the .NET-IDE and create a new project:

Here's the example for getting the environment values and the platform name:

Full project, with .NET project files: jni.zip

For starting the test enter in a DOS-box:

java de.frankbuss.jni.WinAccess

On my Windows XP system the screen will be cleared and I can see the following output:

Win32 on Windows NT/Windows 2000
C:\WINDOWS


26. October 2002, Frank Buß