How can i compile my JNI code using Visual C++ 6.0 on Windows NT/98?

Davanum Srinivas

Cut and Paste the following into a BAT File say BUILD.BAT, assuming that MyWindow.java contains the Java code and MyWindow.CPP contains the C++ JNI code. Adjust the directory path and run the batch file.

@ECHO OFF
SET DEVSTUDIO=D:Program FilesMicrosoft Visual StudioVC98
SET JDK13=D:JDK13
@ECHO ON
%JDK13%binjavac MyWindow.java
%JDK13%binjavah -classpath . MyWindow
@ECHO OFF
SET COMPILE_CMD="%DEVSTUDIO%bincl"
SET COMPILE_CMD=%COMPILE_CMD% MyWindow.CPP
SET COMPILE_CMD=%COMPILE_CMD% -I"%JDK13%INCLUDE"
SET COMPILE_CMD=%COMPILE_CMD% -I"%JDK13%INCLUDEWIN32"
SET COMPILE_CMD=%COMPILE_CMD% -I"%DEVSTUDIO%Include"
SET COMPILE_CMD=%COMPILE_CMD% -FeMyWindow.dll
SET COMPILE_CMD=%COMPILE_CMD% -MD -LD /link 
SET COMPILE_CMD=%COMPILE_CMD% /libpath:""%JDK13%lib"" 
SET COMPILE_CMD=%COMPILE_CMD% /libpath:""%DEVSTUDIO%lib"" 
SET COMPILE_CMD=%COMPILE_CMD% user32.lib gdi32.lib
@ECHO ON
%COMPILE_CMD%
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact