nicarran / jpen

Java library for accessing pen/digitizer tablets and pointing devices
43 stars 17 forks source link

Build issues on multiple platforms #15

Open edgar79 opened 5 years ago

edgar79 commented 5 years ago

I updated the pom.xml and javacTarget to be able to build under macOS 10.14 using openJDK11. The minimum javacTarget using openJDK11 is 1.6. Since jdk8 javah is deprecated and superseded by javac -h. I disabled the javah execution in the macOS profile. Due to deprecations using XCode10 I removed the i386 architecture and set the minimum macOS version to 10.9.

Currently I'm trying to resolve build issues under linux (debian stretch with openJDK8) The linker didn't find the syslib Xi. I fixed it using lib tag with directory. The nar-integration-test is still failing..

According to this forum thread windows build seems to fail too. Until now I didn't find the time to test it on a windows machine.

Kind regards

edgar79 commented 5 years ago

On Debian gnu-linux stretch (stable) and OpenJDK 8 I had an error stating that the surefire main class couldn't be loaded ( during nar-integration-test ) causing the test to fail. I found this workaround to make it possible to use absolute classpaths (instead of relatives) again. It was suggested to add the following to the profiles section in ~/.m2/settings.xml

<profile>
    <id>SUREFIRE-1588</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
    </properties>
</profile>

I reverted some changes ( updates of maven plugin versions ) and the syslib Xi is found again.

edgar79 commented 5 years ago

I'm currently trying to update the pom.xml for Windows 10 I thought to continue this sf forum thread here.

A few notes for building on Windows 10 (64bit) so far:

nicarran commented 5 years ago

Thank you Hannes, I'll be back in about 1 month to merge the changes. I'm currently working on another project and can't appropriately access my jpen files. Cheers!

hamoid commented 2 years ago

Hi @edgar79 :)

Any chance you could share what commands are required to build a working jpen? Should I maybe use your fork? Thank you!

Ah I see I can load the project in Idea. I tried running the compile task and it failed with

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project jpen: Compilation failure: Compilation failure: 
[ERROR] error: Source option 6 is no longer supported. Use 7 or later.
[ERROR] error: Target option 6 is no longer supported. Use 7 or later.

If I switch to 1.7 it complains about javah not being present. I see this comment in pom.xml

          <javah>
            <excludes>
              <exclude>**/WintabAccess.class</exclude>
            </excludes>
            <!-- cmd.exe /X /C ""C:\Program Files\Java\jdk\bin\javah" -classpath "C:\Users\path\jpen\target\classes" -d "C:\Users\path\jpen\target\nar\javah-include" jpen.NarSystem jpen.provider.xinput.XiDevice jpen.provider.osx.CocoaAccess jpen.provider.xinput.XiBus -->
            <!-- javah is deprecated and the c headers are in src/main/c/
                 it should be ok to disable javah execution ; 
                 except that target/nar/nar-generated/NarSystem.java is not processed.
                 May be it's necessary to run javac -h on NarSystem.java
             -->

          </javah>

but I don't know yet what to do about it.

edgar79 commented 2 years ago

Hi @hamoid ;)

If the pom.xml (and the source code) is up to date and contains no deprecations you could run the Maven mvn command to build the project from command line. Maybe we could write the instructions in a build.md file and reference this from readme.md.

My fork is even now with nicarrans code. I think @nicarran is still the maintainer of this project and I would like to assist you in updating this project to be buildable again.

There are some forks of nicarrans repo, so maybe we find a workflow to update it and give resulting pull requests to this repo. If you use my fork I could do pull requests of our results to Nicolas' repository.


The javah executable is not contained in the JDK any more. It's functionality is integrated into javac -h (by using the -h option). In consequence the pom.xml needs to be updated in some places. [...] But probably more needs to be done.

On which platforms do you want to build the project? And which JDK are you using?

Kind regards :)

hamoid commented 2 years ago

Hi @edgar79 :)

I'm giving a try to this library https://github.com/lectureStudio/stylus/issues/3 It would make it much easier for me because I can just add one line to my build.gradle.kts file to get it. If I make it work :)

Another option for the future is that GLFW will support graphic tablets. The framework I use uses lwjgl + GLFW.

Lets see which solution arrives first :)

Thank you for your offer to help! I'm on Linux, working in Kotlin. JDK... I think 15 but I can change it. But using a dependency for gradle would be quite good so I'm going to see if I can make Stylus work first.