World's Best SerialPort Java Developer Tool (since 1996) - World's First Commercial Java Serial Port API Not sure which package to get? SerialMagic is the leading keyboard wedge application for SPP and BLE compatible scanners. Mar 07, 2019 jSerialComm. A platform-independent serial port access library for Java. For usage examples, please refer to the Usage wiki. In order to use the jSerialComm library in your own project, you must simply include the JAR file in your build path and import it like any other Java package using import com.fazecast.jSerialComm.
A platform-independent serial port access library for Java.
Usage
For usage examples, please refer to the Usage wiki.
In order to use the
jSerialComm
library in your own project, you must simplyinclude the JAR file in your build path and import it like any otherJava package using import com.fazecast.jSerialComm.*;
.Alternatively, you can automatically add
jSerialComm
to your project as adependency from the Maven Central Repository
. Use the following dependencydeclaration depending on your build system:- Maven:
- Ivy:
- Groovy:
- Gradle:
- Buildr:
- Scala/SBT:
- Leiningen:
Troubleshooting
If you are using Linux and this library does not appear to be working, ensurethat you have the correct permissions set to access the serial port on your system.One way to test this is to run your application as root or by using the
sudo
command. If everything works, you will need to either run yourapplication as root
in the future or fix the permissions on your system.For further instructions, refer to the Troubleshooting wiki.On some very few systems which use custom ARM-based CPUs and/or have extremelyrestrictive permissions, the library may be unable to determine that theunderlying system architecture is ARM. In this case, you can force thelibrary to disable its auto-detect functionality and instead directly specifythe architecture using the Java
os.arch_full
system property. Acceptablevalues for this property are currently one of: armv5
, armv6
,armv6-hf
, armv7
, armv7-hf
, armv8_32
, armv8_64
,x86
, or x86_64
.An additional note for Linux users: If you are operating this library inevent-based mode, the
LISTENING_EVENT_DATA_WRITTEN
event will never occur.This is not a bug, but rather a limitation of the Linux operating system.For other troubleshooting issues, please see if you can find an answer in eitherthe Usage-Examples wikior the Troubleshooting Wiki.
If your question is still not answered, feel free to open an issue report onthis project's GitHub page,and we will be glad to look into it.
Building
Building this library yourself is not advised (at least not for distribution)since it requires native compilation across multiple platforms. It isrecommended to simply use the pre-built
jSerialComm
library in yourapplication. For installation/usage instructions, please skip to the usage section.Frequently Asked Questions. Click 'Yes' to confirm the uninstallation. Double-click the 'Add/Remove Programs' icon. Powerdvd 10 free download for windows 10. Select 'CyberLink PowerDVD' and right click, then select Uninstall/Change.
If you do choose to build this library for your specific system, the recommendedmethodology is to use Gradle coupled with theJava SDK, version 1.6(for backward compatibility).
Once the Java SDK 1.6 has been installed, ensure that you have an environmentvariable called
JDK_HOME
set to the base directory of your JDK installation.Once this has been done, refer to the section corresponding to your specificOperating System for further instructions.Please note, if you would like to edit any of the source code or view it in anIDE (such as Eclipse), you can automatically build the Eclipse project files byentering the following on a command line or terminal from the base directory ofthis project:
You can then Import the project using the 'Existing Project into Workspace' importtool in Eclipse. (Note that if you use Eclipse as an IDE, you will probably wantto install the Eclipse CDT plugin for proper handling of the C source code).
Linux/UNIX
Ensure that the following tools are installed on your Linux distribution:
Ensure that the
JDK_HOME
environment variable has been set for the 1.6version of your Java SDK. The correct directory can usually be found by enteringthe following command:Export the result of this command up to but not including the
/jre/..
portion using the export
command. For example, ifreadlink
produced /usr/lib/jvm/java-6-jdk/jre/bin/java
as an output,the export command would look like: export JDK_HOME=/usr/lib/jvm/java-6-jdk
Run the following commands:
The resulting
jSerialComm
library can be found in the project directorybuild/libs
under the name jSerialComm-{VERSION}.jar
.Solaris
Ensure that you have a cross-compiler installed on your Linux distributioncapable of compiling for both x86 and Sparc-based Solaris architectures.Instructions for creating such a toolchain can be found on theSolaris Cross-Compiler wiki.
Ensure that the
JDK_HOME
environment variable has been set for the 1.6version of your Java SDK. The correct directory can usually be found by enteringthe following command:Export the result of this command up to but not including the
/jre/..
portion using the export
command. For example, ifreadlink
produced /usr/lib/jvm/java-6-jdk/jre/bin/java
as an output,the export command would look like: export JDK_HOME=/usr/lib/jvm/java-6-jdk
Run the following commands:
The resulting
jSerialComm
library can be found in the project directorybuild/libs
under the name jSerialComm-{VERSION}.jar
.ARM-Based Mobile Linux (non-Android)
Ensure that you have a cross-compiler installed on your Linux distributioncapable of compiling for ARM-based architectures. I prefer
crosstool-ng
for this purpose.Java Serial Port Example
Ensure that the
JDK_HOME
environment variable has been set for the 1.6version of your Java SDK. The correct directory can usually be found by enteringthe following command:Export the result of this command up to but not including the
/jre/..
portion using the export
command. For example, ifreadlink
produced /usr/lib/jvm/java-6-jdk/jre/bin/java
as an output,the export command would look like: export JDK_HOME=/usr/lib/jvm/java-6-jdk
Run the following commands:
The resulting
jSerialComm
library can be found in the project directorybuild/libs
under the name jSerialComm-{VERSION}.jar
.Android
Ensure that the Android NDK is installed on your system. For purposes of theseinstructions, assume that it is installed at
{NDK_HOME}
.Run the following commands in order:
The resulting
jSerialComm
library can be found in the project directorybuild/libs
under the name jSerialComm-{VERSION}.jar
Mac OS X
Ensure that Xcode is installed on your system.If it is not, it can be downloaded via the App Store. You must also make surethat the
Xcode Command Line Tools
are installed. This can be done byentering the following command in a terminal: xcode-select --install
Run the following commands in order:
The resulting
jSerialComm
library can be found in the project directorybuild/libs
under the name jSerialComm-{VERSION}.jar
Windows
Ensure that the Visual Studio C++ Compiler isinstalled on your system.
On Windows, the Visual Studio Compiler must be configured to build either32- or 64-bit binaries but never both at the same time. Therefore, you will haveto build binaries for the two architectures separately.
Open a command prompt and run the following command:
where
[version]
matches the version of the Visual Studio C++ Compiler
that is installed.Java Serial Port Windows
Then run:
Java Serial Port Programming
The resulting
jSerialComm
library can be found in the project directorybuild/libs
under the name jSerialComm-{VERSION}.jar