JNI Part 2: Visual Studio setup for DLL Project

Here is the simple steps to DLL project in Visual Studio

  1. Open Visual Studio
  2. Click File->New Project, and select Empty project
  3. Write Name and select location
  4. Click ok
JNI: Creating new Dll project
JNI: Creating new Dll project
  1. Go to Project->Properties
  2. On the left side, select general in configuration properties
  3. Select Dynamic Library(.dll) as configuration Type
Dll Project Configuration
Dll Project Configuration
  1. Next click C/C++
  2. Add jdk include and win32 path in Additional Include Directories
  3. If you have installed jdk in c program files then the path is
  4. C:\Program Files\Java\jdk1.6.0_18\include; C:\Program Files\Java\jdk1.6.0_18\include\win32
  5. Click OK button.
Dll Project Add Include Directories
Dll Project adding include directories
  1. Now the configuration of the project is done. Next step is to add files to the project.
  2. As shown in below image, right click on the “Header Files” folder and select Add, Existing Item
  3. Select Header files and add to the project.
DLL adding files
DLL adding files

Finally solution explorer will look like:

Solution Explorer after adding files
Solution Explorer
  1. Build Solution: Go to Build->Build Solution
  2. Solve the errors if any found in output window.
  3. Once the build is successful then the generated dll will be in the output directory.
Editorial Team
Editorial Team

We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.

3 thoughts on “JNI Part 2: Visual Studio setup for DLL Project

  1. How can i do visual studio setup for Microsoft Visual C++ 2010 Express edition.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.