After having lirc working on the Raspberry Pi, I wanted a Java program that can talk with lirc and make it possible to intercept infrared signals from a remote control via java code.  That is were JLirc comes in.  JLirc is a java api for using lirc.  More information about can be found on JLirc

The installation instructions can be found on an install file which you can find in the sources zip.  You have to download the sources to your raspberry pi and extract the zip.  Than you need to do a build (Makefile).  Important note is that you have to use the option  -march=armv7-a instead of what was original in the Makefile.  It will not build if you don’t change it.Once built you have to first launch the lirc deamon :

sudo service lirc start

and than launch the test application which is in the sources :

java -cp . org.lirc.test.Irw

As a result when you hit a button on the remote control you should see something similar like this :

pi@raspberrypi ~/lirctest/build $ java -cp . org.lirc.test.Irw
0000000000fda857 00 KEY_5 /home/pi/lircd.conf.conf

Pretty simple isn’t it.

2 thoughts on “JLIRC

  1. Reaper says:


    Sry but I’m pretty new to this. Would you please be so kind to give me an explanation of what you exactly meant with “you need to do a build (Makefile)”?


    • Jan Bylé says:


      my apologies for the long time between your question and my answer. You can find the sources for JLirc on https://sourceforge.net/projects/jlirc/files/
      To make the example run you need to run the compilation via the Makefile. It was mentioned in the INSTALL file which is also part of the sources. I had to do some trial and error before I figured out I had to change some options in the makefile as mentioned in my blog.

      Hope this helps. Don’t hesitate to come back to me in case your question is not fully answered.


Leave a Reply