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

GemsFX 1.29.1 - SearchTextField //missing export in module-info #47

Closed
todayifeeltired opened this issue Mar 31, 2022 · 24 comments
Closed

Comments

@todayifeeltired
Copy link

Hello :)
When using the SearchTextFIeld i get the message "module com.dlsc.gemsfx does not export com.dlsc.gemsfx.skins to module javafx.fxml". I saw that this has been fixed in newer releases, but i dont want to upgrade from JDK 11.
Is it possible/planned to fix this?
Thanks in advance

@dlemmermann
Copy link
Collaborator

You don't have to upgrade ... GemsFX is (should be) Java 11 compatible. Isn't it?

@dlemmermann
Copy link
Collaborator

I checked ... it is targeting 11.

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>11</release>
                    <source>11</source>
                    <target>11</target>
                </configuration>

@todayifeeltired
Copy link
Author

Thanks for the fast reply.
interesting.
maven clean install claims "Unsupported major.minor version 56.0" for every version beyond 1.29.1

@dlemmermann
Copy link
Collaborator

Yes, older versions used the wrong Java version. Please use 1.41

@dlemmermann
Copy link
Collaborator

Actually 1.42.

@todayifeeltired
Copy link
Author

i get the error also for 1.41 and 1.42 :/

@dlemmermann
Copy link
Collaborator

Are you building the project yourself or downloading from Maven central?

@dlemmermann
Copy link
Collaborator

You might also consider using the enforcer plugin in your pom.xml file (hope you use Maven). This way you get told which dependency is using what.

<properties>
    <java.version>11</java.version>
</properties>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
               .....
 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>1.5.1</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <rules combine.children="override">
                                <requireMavenVersion>
                                    <version>${maven.version}</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${java.version}</version>
                                </requireJavaVersion>
                                <enforceBytecodeVersion>
                                    <maxJdkVersion>${java.version}</maxJdkVersion>
                                </enforceBytecodeVersion>
                                <dependencyConvergence/>
                                <requireUpperBoundDeps/>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

@todayifeeltired
Copy link
Author

yes, i am using maven and i am downloading gemsfx via maven.
i´ll give the enforcer-plugin a shot

@todayifeeltired
Copy link
Author

todayifeeltired commented Mar 31, 2022

the enforcer plugin says it requires upper bound dependencies for some, but i dont understand how to fix the gemsfx issue with it.
i´m sure that is has to do something with the gemsfx-version because the clean install works with gemsfx 1.29.1.
or am i wrong with something?

@dlemmermann
Copy link
Collaborator

I checked the manifest file and it shows this:

Manifest-Version: 1.0
Created-By: Maven Archiver 3.4.0
Build-Jdk-Spec: 17
Implementation-Title: GemsFX
Implementation-Version: 1.42
Implementation-Vendor: DLSC Software & Consulting
Build-Jdk: 11 (Oracle Corporation 17.0.1+12-39)
Build-OS: Mac OS X x86_64 12.2.1
Build-Revision: 7d198b6
Build-Timestamp: 2022-03-25T18:03:00+01:00

That looks correct to me.

@todayifeeltired
Copy link
Author

it looks correct to me to.
I made a new JavaFX project with the Intellij-Template

`

4.0.0

<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
<name>demo</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit.version>5.8.1</junit.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>11.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>11.0.2</version>
    </dependency>

    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.dlsc.gemsfx</groupId>
        <artifactId>gemsfx</artifactId>
        <version>1.42</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>11</source>
                <target>11</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>0.0.8</version>
            <executions>
                <execution>
                    <!-- Default configuration for running with: mvn clean javafx:run -->
                    <id>default-cli</id>
                    <configuration>
                        <mainClass>com.example.demo/com.example.demo.HelloApplication</mainClass>
                        <launcher>app</launcher>
                        <jlinkZipName>app</jlinkZipName>
                        <jlinkImageName>app</jlinkImageName>
                        <noManPages>true</noManPages>
                        <stripDebug>true</stripDebug>
                        <noHeaderFiles>true</noHeaderFiles>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

`

I added gemsfx 1.42 as a dependency.

Maven clean install still claims "Unsupported major.minor version 56.0" :(

@dlemmermann
Copy link
Collaborator

Try excluding this dependency from GemsFX. It is a multi-version JAR file that gets pulled in because of GemsFX dependency to UnitFX.

Screenshot 2022-03-31 at 15 21 12

@dlemmermann
Copy link
Collaborator

you can also get around it by using a newer JDK to compile ... Simply use a JDK > 11 and everything works fine. Since you specify the Java version target in the pom.xml file the compiled code will be Java 11 compatible. I just realised that this is the reason that I did not notice this problem. I use JDK 17 or 18.

@dlemmermann
Copy link
Collaborator

Actually my last comment is what you want to do.

@todayifeeltired
Copy link
Author

okay but then i need to ugrade from jdk 11. idk i like to have the same jdk as the target i´m trying to compile.

@dlemmermann
Copy link
Collaborator

Maybe you find some maven docs on how to exclude code inside multi-version jar files that require a newer java version?

@todayifeeltired
Copy link
Author

should it be working if i exclude the whole tech.units:indriya:2.1.2 or only the java 12 and 14 parts?

@dlemmermann
Copy link
Collaborator

Not sure you can exclude parts individually. Probably the whole thing needs to be excluded.

@todayifeeltired
Copy link
Author

todayifeeltired commented Mar 31, 2022

it works!!
thank you very much

one last question: why has gemsfx a dependency to tech.units:indriya when it works without it? was just wondering
will close the issue with the solution later

@todayifeeltired
Copy link
Author

oh and btw, is there anyway to paypal a beer/coffee to you because of gemsfx and your help today?

@dlemmermann
Copy link
Collaborator

gemsfx has a dependency to UnitFX and UnitFX has the dependency to tech.units:indriya. Some of the controls inside GemsFX require controls from UnitFX.

@dlemmermann
Copy link
Collaborator

Sponsoring is available here: https://github.com/dlsc-software-consulting-gmbh

@todayifeeltired
Copy link
Author

solution:
<dependency> <groupId>com.dlsc.gemsfx</groupId> <artifactId>gemsfx</artifactId> <exclusions> <exclusion> <groupId>tech.units</groupId> <artifactId>indriya</artifactId> </exclusion> </exclusions> <version>1.42</version> </dependency>

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

2 participants