Using python OBD in jython
Hi,
I am trying to use this package with jython. I already installed it in my jython site-packages. Whenever I run a script that has the line "import obd" I get the following error message:
File "test.py", line 2, in
Any idea on how to run this package with jython? Any suggestion would be greatly appreciated.
Thanks!
anyone here?
@dia986 Your problem is that your Java installation does not actually have the "Java Communications API" libraries, javax.comm.*, which Java needs in order to talk to serial ports. It seems like Oracle got bored of them and stopped including them in its Java releases (or never shipped them by default to begin with). Also, Oracle seems to only have the current version for Linux.
A bunch of people on StackOverflow were scratching their heads over this about a decade ago, and they were passing around some links to old versions and install instructions.
It looks like gnu.io.* can also be used by PySerial when running on Jython; that is the "RXTX" library. The best Windows builds I think are put out by whoever runs Fizzed.com. You can download the right ZIP for your Java (depending on if you have 32-bit or 64-bit Java), and follow the included Install.txt instructions to copy the files into your Java installation. To do that, you need to figure out where your Java installation actually is (i.e. what JAVA_HOME ought to be). I think you can do set JAVA_HOME at the Windows command prompt, or type %JAVA_HOME% into the location bar in the file manager, or maybe do where java at the command prompt and then go up to the folder holding the bin folder that Java itself is in.