2

It seems the hurdle with being about to using javax.comm for working with COM ports is the placement of two files win32com.dll and javax.comm.properties. They need to go in the JRE and/or JDK folders, which isn't particularly good making the application easy to distribute to a wide audience.

I'll need to take my programme and use it on a variety of computers where I don't have the privileges to make such changes.

Is there no way to bring these files with my jar and have them work where they lie, as with the comm.jar file itself?

If not, then I'll have to presume that javax.comm isn't going to be of use and find another language to write my programme.

Glom
  • 21
  • 1

1 Answers1

1

You can use the system property java.ext.dirs.

As of Java 6, extension JAR files may also be placed in a location that is independent of any particular JRE, so that extensions can be shared by all JREs that are installed on a system. Prior to Java 6, the value of java.ext.dirs referred to a single directory, but as of Java 6 it is a list of directories (like CLASSPATH) that specifies the locations in which extensions are searched for. The first element of the path is always the lib/ext directory of the JRE. The second element is a directory outside of the JRE. This other location allows extension JAR files to be installed once and used by several JREs installed on that system. The location varies depending on the operating system:

See this https://docs.oracle.com/javase/tutorial/ext/basics/install.html

JJF
  • 2,681
  • 2
  • 18
  • 31