nyholku / purejavacomm

Pure Java implementation of JavaComm SerialPort
http://www.sparetimelabs.com/purejavacomm/index.html
BSD 3-Clause "New" or "Revised" License
367 stars 146 forks source link

PureJavaComm Build for Java 1.6 32bit #99

Open lholho opened 7 years ago

lholho commented 7 years ago

I would like to use PJC. However, the projects I deal with are all Java 1.6 32bit based. I see that the latest maven builds are all on at least Java 7. Is it possible for someone to share a jar file of the latest builds that is compatible with Java 6? The last version I could find is 0.0.23 which I get an occassional exception which makes it unusable:

jtermios.windows.JTermiosImpl$Fail at jtermios.windows.JTermiosImpl$Port.fail(JTermiosImpl.java:102) at jtermios.windows.JTermiosImpl.select(JTermiosImpl.java:844) at jtermios.JTermios.select(JTermios.java:439) at purejavacomm.PureJavaSerialPort$3.run(PureJavaSerialPort.java:1226) at java.lang.Thread.run(Unknown Source)

I am hoping that the latest build resolves the above. Replacing PJC with RXTX does not result in any errors.

derikd commented 7 years ago

I also compile against Java 6 for my application. I use the raw sources for version 1.0 in my project rather than the JAR files. I compile the entire project (including PJC) against Java 6 SDK and JNA 4.0 and I have no errors. I do get some warnings because jtermios uses Native.setPreserveLastError() which is deprecated.

I haven’t noticed any changes in the recent updates (since 1.0) that would change that.

If you want to use the JARS, download the sources and build against Java 6 SDK to create a Java 6 jar.

On Mar 3, 2017, at 10:10 AM, lholho notifications@github.com<mailto:notifications@github.com> wrote:

I would like to use PJC. However, the projects I deal with are all Java 1.6 32bit based. I see that the latest maven builds are all on at least Java 7. Is it possible for someone to share a jar file of the latest builds that is compatible with Java 6? The last version I could find is 0.0.23 which I get an occassional exception which makes it unusable:

jtermios.windows.JTermiosImpl$Fail at jtermios.windows.JTermiosImpl$Port.fail(JTermiosImpl.java:102) at jtermios.windows.JTermiosImpl.select(JTermiosImpl.java:844) at jtermios.JTermios.select(JTermios.java:439) at purejavacomm.PureJavaSerialPort$3.run(PureJavaSerialPort.java:1226) at java.lang.Thread.run(Unknown Source)

I am hoping that the latest build resolves the above. Replacing PJC with RXTX does not result in any errors.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/nyholku/purejavacomm/issues/99, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOMXD28mvWohcjv3hQqNbrNOcfN-oNkjks5riFengaJpZM4MSkqN.

lholho commented 7 years ago

Hi derikd

I am not a strong programmer (actually I am not a programmer). Hence, I am not sure how to get the sources compiled. Is it as simple as downloading the project, creating a new on within my eclipse workspace and type in "mvn package" at the command line. Thanks for any direction

derikd commented 7 years ago

Iholho,

I took a stab at this myself. I have never done anything like this before. So I can’t make promises. I created this jar, then created a second Java6 program and used this jar. It seemed to work okay for me. http://software.celestron.com/pjc/PJC_SDK6_1_01.jar

I don’t want to leave this file on that server forever. Please let me know when you have it and if it worked for you.

— derik

On Mar 3, 2017, at 11:47 AM, lholho notifications@github.com<mailto:notifications@github.com> wrote:

Hi derikd

I am not a strong programmer (actually I am not a programmer). Hence, I am not sure how to get the sources compiled. Is it as simple as downloading the project, creating a new on within my eclipse workspace and type in "mvn package" at the command line. Thanks for any direction

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/nyholku/purejavacomm/issues/99#issuecomment-284052366, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOMXDx-ISV7HI4wWZ8Z6Flx-_SNDwBvYks5riG5ugaJpZM4MSkqN.

derikd commented 7 years ago

On that same address I also posted the JNA library that PureJavaComm relies on. You will need to link your project to that jar as well PureJavaComm. I didn’t make any changes to that library. I have no idea what version of java it is compiled against. But I think it is the same one I used to test against so it should be okay for you too.

On Mar 3, 2017, at 11:47 AM, lholho notifications@github.com<mailto:notifications@github.com> wrote:

Hi derikd

I am not a strong programmer (actually I am not a programmer). Hence, I am not sure how to get the sources compiled. Is it as simple as downloading the project, creating a new on within my eclipse workspace and type in "mvn package" at the command line. Thanks for any direction

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/nyholku/purejavacomm/issues/99#issuecomment-284052366, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOMXDx-ISV7HI4wWZ8Z6Flx-_SNDwBvYks5riG5ugaJpZM4MSkqN.

lholho commented 7 years ago

Thanks for the file. A quick test shows that it loads. I will do a more thorough test later. Nevertheless, thank you for your help.

WickedShell commented 7 years ago

Is there a particular reason why the version distributed through maven requires Java 8? At some point someone recompiled 1.0.0 from Java 5 to Java 8 which breaks support for all the intermediate versions, of which Java 7 particularly still has a large deployed base.

nyholku commented 7 years ago

No, not really except I lost my Java 6 (MacOs) at some point so I have to recover that before I can compile against that. I'll try to do that at some point.

WickedShell commented 7 years ago

You can specify the -target 1.6 to specify the compile target even if you are on a newer JVM. This should allow you to release builds that are compatible even though you don't have a Java 6 machine anymore.

nyholku commented 7 years ago

True, forgot, I will try to get round to recompiling this at some point.

WickedShell commented 7 years ago

Thanks!

On Tue, Jun 20, 2017 at 8:49 PM, nyholku notifications@github.com wrote:

True, forgot, I will try to get round to recompiling this at some point.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nyholku/purejavacomm/issues/99#issuecomment-309955199, or mute the thread https://github.com/notifications/unsubscribe-auth/AAipiNuldsjoU07g9fBquviNPEgUwuq0ks5sGJLAgaJpZM4MSkqN .