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

Update to Java 17 and Maven libraries #1

Open
wants to merge 6 commits into
base: fx
Choose a base branch
from

Conversation

vogella
Copy link

@vogella vogella commented Jan 9, 2024

This example has been updated to Java 17 using the following approach:

To use JavaFX from Maven Central, the following was added to the target platform:




org.openjfx
javafx-controls
22-ea+16
jar


org.openjfx
javafx-fxml
22-ea+16
jar


Unfortunately the JavaFX SWT libraries is not available via Maven artifacts, you have to extract it from the the zip file. This is platform specific:

Windows: Contained in JAR file of Javafx controls
Linux: Contained in the JAR file of Javafx graphics jar The JAR files in which the JAR file is included is located in .m2/repository/org/openjfx/compoent/version for example: .m2/repository/org/openjfx/javafx-graphics/21

Unfortunately the target platform downloads the platform specific artifacts from Maven using the same bundle name. PDE resolves in some cases (this seems to be platform and library version specific) to the bundle which does not contain the implementation. Therefore, you might have to copy the JAR files into your project and add them to the MANIFEST.MF file.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Inverter
Bundle-SymbolicName: org.fipro.eclipse.tutorial.inverter Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
org.eclipse.jface;bundle-version="3.10.1",
javax.annotation;bundle-version="1.2.0",
javax.inject;bundle-version="1.0.0"
Automatic-Module-Name: org.fipro.eclipse.tutorial.inverter Bundle-ClassPath: .,
lib/javafx-base-17.0.9.jar,
lib/javafx-base-17.0.9-linux.jar,
lib/javafx-fxml-17.0.9.jar,
lib/javafx-fxml-17.0.9-linux.jar,
lib/javafx-graphics-17.0.9.jar,
lib/javafx-graphics-17.0.9-linux.jar,
lib/javafx-swt.jar,
lib/javafx-controls-17.0.9.jar,
lib/javafx-controls-17.0.9-linux.jar

fipro78 and others added 6 commits March 29, 2015 16:56
This example has been updated to Java 17 using the following approach:

To use JavaFX from Maven Central, the following was added  to the target
platform:

<location includeDependencyDepth="infinite"
includeDependencyScopes="compile,runtime" includeSource="true"
label="Tools Platform Libs" missingManifest="generate" type="Maven">
		  <dependencies>
			  <dependency>
				  <groupId>org.openjfx</groupId>
				  <artifactId>javafx-controls</artifactId>
				  <version>22-ea+16</version>
				  <type>jar</type>
			  </dependency>
			  <dependency>
				  <groupId>org.openjfx</groupId>
				  <artifactId>javafx-fxml</artifactId>
				  <version>22-ea+16</version>
				  <type>jar</type>
			  </dependency>
		  </dependencies>
	  </location>

Unfortunately the JavaFX SWT libraries is not available via Maven
artifacts, you have to extract it from the the zip file.
This is platform specific:

Windows: Contained in JAR file of Javafx controls
Linux: Contained in the JAR file of Javafx graphics jar
The JAR files in which the JAR file is included is located in
.m2/repository/org/openjfx/compoent/version for example:
.m2/repository/org/openjfx/javafx-graphics/21

Unfortunately the target platform downloads the platform specific
artifacts from Maven using the same bundle name. PDE resolves in some
cases (this seems to be platform and library version specific) to the
bundle which does not contain the implementation. Therefore, you might
have to copy the JAR files into your project and add them to the
MANIFEST.MF file.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Inverter
Bundle-SymbolicName: org.fipro.eclipse.tutorial.inverter
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
 org.eclipse.jface;bundle-version="3.10.1",
 javax.annotation;bundle-version="1.2.0",
 javax.inject;bundle-version="1.0.0"
Automatic-Module-Name: org.fipro.eclipse.tutorial.inverter
Bundle-ClassPath: .,
 lib/javafx-base-17.0.9.jar,
 lib/javafx-base-17.0.9-linux.jar,
 lib/javafx-fxml-17.0.9.jar,
 lib/javafx-fxml-17.0.9-linux.jar,
 lib/javafx-graphics-17.0.9.jar,
 lib/javafx-graphics-17.0.9-linux.jar,
 lib/javafx-swt.jar,
 lib/javafx-controls-17.0.9.jar,
 lib/javafx-controls-17.0.9-linux.jar
@fipro78 fipro78 force-pushed the fx branch 2 times, most recently from 0094478 to 30e0efc Compare May 22, 2024 05:29
@fipro78 fipro78 force-pushed the fx branch 3 times, most recently from 0e05c01 to e5f41ab Compare June 3, 2024 11:22
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

Successfully merging this pull request may close these issues.

2 participants