Language - Java

From Phidgets Support


Get Started

With the Phidget22 library, it's easy to create Java applications that work with Phidget devices.

Java Libraries

Source Files

The Phidget22 Java library source files are available here.

Development Environment Configuration

Before choosing a development environment, make sure you have the Java Development Kit installed.

Javac

Instructions
The easiest way to allow Java to access the Phidgets Java library is to place a copy of phidget22.jar in the same folder as your .java program.
Language java javac folder.png
You can download phidget22.jar here.
Once you are ready to run your program, enter the following command in the command prompt or terminal:
javac -classpath .;phidget22.jar example.java

Finally, enter the following command to run the program:

java -classpath .;phidget22.jar example

Netbeans

Instructions
The easiest way to allow Java to access the Phidgets Java library is to place a copy of phidget22.jar in the same folder as your .java program.
Language java javac folder.png
You can download phidget22.jar here.
To start, open NetBeans and create a new project. Select Java Application and follow the steps as directed by Netbeans.
Windows netbeans1.jpg
Next, add a reference to phidget22.jar by right-clicking on the libraries folder.
Windows netbeans2.jpg
Navigate to the folder where you downloaded phidget22.jar, and select it.
Windows netbeans3.jpg
The project now has access to Phidgets.

Eclipse

Instructions
The easiest way to allow Java to access the Phidgets Java library is to place a copy of phidget22.jar in the same folder as your .java program.
Language java javac folder.png
You can download phidget22.jar here.
To start, open Eclipse and create a new Java project.
Windows eclipse1.jpg
On the Libraries tab, click Add External JARs and add phidget22.jar to your project as an external jar.
Windows eclipse2.jpg
Create a new Class in your project.
Windows eclipse3.jpg
Name the class, and be sure to check the public static void main box.
Windows eclipse4.jpg
Your project now has access to Phidgets!

PhidgetSBC Web Interface

Instructions

Example Code

Navigate to our Code Sample Generator to view and download code samples that are tailored to your specific device.

Language java codesample.png

Phidget Programming Basics

To learn more about the structure of the example code, visit our Phidget Programming Basics guide.

API

Phidget22 API