Click here to Skip to main content
11,704,768 members (50,728 online)
Click here to Skip to main content
Add your own
alternative version

GPU Computing Using CUDA, Eclipse, and Java with JCuda

, 21 Sep 2013 CPOL 41K 477 22
Tutorial: GPU computing with JCuda and Nsight (Eclipse)
From Eclipse you make a runnable jar from

From Project Explorer > Export > Java > Runnable Jar file > Next

Set the launch configuration, pick a destination, and extract the libraries into the jar.
Click finish, acknowledge your actions with reguard to licenses, address errors, and review warnings.

To run a jar that uses native libraries, you can point to the native binary folder with the -DJava.library.path switch when you run the jar. 

Syntax java -Djava.library.path=<the exact path to the native library> -jar your.jar

For example, I have an executable jar with filespec: '/home/max/CodeProjectMBishop/javaFFT.jar'

It uses native libraries located in the folder: '/home/max/Cuda/JCuda-All-0.5.0-bin-linux-x86_32 -jar'

I run:

java -Djava.library.path=/home/max/Cuda/JCuda-All-0.5.0-bin-linux-x86_32 -jar '/home/max/CodeProjectMBishop/javaFFT.jar'

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Mark H Bishop
President PEI Watershed Alliance, Inc.
United States United States
I am a scientist and not a professional programmer. I program primarily to perform matrix computations for regression analysis, process signals, acquire data from sensors, and to control devices.

I have a personal web page at

I am the Chairperson and one of the primary founders of the Prince Edward Island Watershed Alliance, Inc.:

I participate in many open source development communities and Linux user forums.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150819.1 | Last Updated 21 Sep 2013
Article Copyright 2012 by Mark H Bishop
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid