CS151 Object Oriented Programming

Homework 4

Cool JNI Exercise


This exercise is going to give students exposure to Java Native Interface (JNI) concept. You are required to write two programs.

C++ Program

Write a C++ program named dosCommand.cpp using MSVC++ that does the following:


Java Program

Write a Java program named j2dosDriver.java using JDK 1.3 that does the following:


Extra Credit

Extra credit is built in in the program. In order to do this homework, you have to research how JNI program is built, how to use javah, how to build DLL in Windows, how to map Java types. to C++ types. While most of the concepts will be covered later in the class, it is essential you do your research as needed. (If you wait for the lectures, it is going to be too late.) Good Luck :)


NOTE: What to handin: