Using JMyron with Scala in IntelliJ

For today’s sketch I wanted to use the webcam as input into some sort of simulation (gray-scott or particles I’m thinking), but I first had to set up IntelliJ to use JMyron. Originally I tried simply adding jmyron.jar as a dependency, but initializing the library (new JMyron()) threw an “java.lang.UnsatisfiedLinkError: no JMyron in java.library.path”. Inspection of java.library.path showed no jmyron.jar entry, which makes sense since java.library.path should be pointing at places for Java to look for DLLs and not jars. I’m confused as to why JMyron would want the jar file to be in library.path. JMyron depends on two dlls (myron_ezcam.dll and DSVL.dll) and some native calls in order to talk to the webcam, and those dlls must be reached from library.path – but the jar file shouldn’t matter. Should it? Maybe it has something to do with the fact that, for this sketch, I’m using a 32-bit jre on 64-bit Windows 7, meaning dll calls get forwarded to C:\Windows\SysWOW64 (which, on my machine, also holds myron_ezcam.dll and DSVL.dll).

In the end I chose to edit the %PATH% variable to include the directory that jmyron.jar lived in. I also had to check “Use alternative JRE” and point it to the 32 bit jre (my default Java installation is 64 bit). With those two modifications I’m now getting a functional jmyron library inside IntelliJ, ready to be tampered with using Scala! Party/programming time! (Same thing, right?) I think I’ll do something that outlines the features of my face (or any object against a background) and spews chemical/particles from those features.


One Comment on “Using JMyron with Scala in IntelliJ”

  1. alexzm1 says:

    just add the jMyron.dll that was inside the directory with the .jar file of jMyron in the System32 directory and you don’t have to edit the %PATH%

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s