webcam-capture icon indicating copy to clipboard operation
webcam-capture copied to clipboard

Java 9

Open trauchhaupt opened this issue 7 years ago • 8 comments

Running with Java 9 does not work, as

  • The jar file (and therefore the automatic module) is not an open module, but wants BridJ to load the DLLs from itself
  • BridJ is not Java 9 compatible, as the loading of the resources (dlls) uses the wrong classloader

trauchhaupt avatar Nov 21 '17 08:11 trauchhaupt

Hi @trauchhaupt, thank you for reporting this, but I'm afraid I can't move forward with Java 9 before fix for BridJ is available. I would love to take a look at this on my own, but with current workload on my head I have no time to play with bugs :( I'm sure, however, that Olivier (BridJ owner) will love to see pull request with a fix for this issue :)

sarxos avatar Dec 05 '17 17:12 sarxos

BridJ is looking like it is unmaintained. Are there any plans to migrate to something newer or that is maintained?

msgilligan avatar Apr 29 '19 23:04 msgilligan

So, to be clear Java 9+ will work if webcam-capture is loaded on the classpath. (At least that what I'm seeing in my basic testing.) This issue is about library loading not working when using the Java Platform Module System. Right?

msgilligan avatar Apr 30 '19 03:04 msgilligan

So, unmerged BridJ PR #103 seems to fix the problem for me.

I forked BridJ and created a https://jitpack.io build using the msgilligan-master branch. I have successfully used to build and run webcam-capture on JDK 11/12 in a modular app.

Here are the relevant bits of my build.gradle:

repositories {
    maven { url 'https://oss.sonatype.org/content/groups/public' }
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation "com.github.msgilligan:BridJ:msgilligan-master-SNAPSHOT"

    implementation ("com.github.sarxos:webcam-capture:0.3.12") {
       // The exclude is necessary so we don't have 2 versions of the same packages
        exclude group: 'com.nativelibs4java', module: 'bridj'
    }
}

msgilligan avatar Apr 30 '19 07:04 msgilligan

@sarxos -- let's make a fork/release of the patch to BridJ! Are you game?

msgilligan avatar Aug 23 '19 01:08 msgilligan

OK, I've created a fork of BridJ in the ConsensusJ organization:

https://github.com/ConsensusJ/BridJ

This (in the consensusj-master branch) has PR #103 and also pulls in essential build configuration from what was previously a parent POM. It can be accessed through jitpack.io, but I can push it to a Bintray maven repo after a little more testing.

msgilligan avatar Oct 04 '19 07:10 msgilligan

any answer regarding this issue till now? I'm trying to use the library in modular gradle application and it seems it doesn't support JPMS yet.

doct0rX avatar Apr 01 '23 14:04 doct0rX