Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues on multiple platforms #15

Open
edgar79 opened this issue Nov 2, 2018 · 6 comments
Open

Build issues on multiple platforms #15

edgar79 opened this issue Nov 2, 2018 · 6 comments

Comments

@edgar79
Copy link
Contributor

edgar79 commented Nov 2, 2018

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
Copy link
Contributor Author

edgar79 commented Nov 2, 2018

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
Copy link
Contributor Author

edgar79 commented Nov 3, 2018

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:

  • the build.properties file should be a link to src\main\resources\jpen\build.properties (on my system the file was not a symlink after cloning)
  • the linux profiles are loaded due to the activation settings, you can add os family unix to the amd64 and i386-on-amd64 profiles
<id>amd64</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
  • if you are using an openJDK version without javah (openJDK > 8) you can disable the javah execution. I'm not sure if the header generation is necessary on Windows. May be a workaround would be an antrun using javac -h manually... Add the following to the plugin executions of nar-maven-plugin
<executions>
     <execution>
           <id>default-nar-javah</id>
           <phase>none</phase>
     </execution>
</executions>
  • If you use openJDK11 then the module.javacTarget in build.properties (and module.properties) should be set to 1.6

@nicarran
Copy link
Owner

nicarran commented Nov 6, 2018

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
Copy link

hamoid commented May 26, 2022

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
Copy link
Contributor Author

edgar79 commented May 28, 2022

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
Copy link

hamoid commented May 29, 2022

Hi @edgar79 :)

I'm giving a try to this library lectureStudio/stylus#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants