1

I am developing a Java application which has to be executed and installed without admin rights. My application needs the win32com.dll (Java Communication API) and the file javax.comm.properties.

Normally, I just copy the dll to C:\Java\jre1.6\bin and the config file to C:\Java\jre1.6\lib.

But I can't do all that in the target environment. Is there a way to solve this problem?

E.g. passing the location of these files to the java command in the command line, or including the files into the jar and load them from the source code?

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
Dominik
  • 1,016
  • 11
  • 30
  • This was helpful, but didn't quite take me to the finish line. I provided a [more comprehensive answer to this here](http://stackoverflow.com/a/37122632/3485639). – dugsmith May 09 '16 at 18:37

1 Answers1

1

Yes, you can just use something like this

java -Djava.library.path=/path/to/the/win32com.dll -cp /my/classpath/;/my/classpath2/ my.main.TheClass
Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
  • 1
    The driver including worked like a charm, but the javax.comm.properties thing didn't work. I had to sepficy the path to comm.jar as a classpath and then put the properties files there (just for anyone else googling for the same problem). thanks a lot :) – Dominik Jan 06 '14 at 15:16