Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Maven build fails
Maven build fails [message #1118277] Fri, 27 September 2013 04:40 Go to next message
Eclipse UserFriend
I am trying to build using maven and getting this error:

[ERROR] package test.app;
[ERROR] ^
[ERROR] The type javafx.application.Application cannot be resolved. It is indire
ctly referenced from required .class files
[ERROR] 1 problem (1 error)


I have created a simple "OSGi Application Project" using the fx tooling on Kepler.
The get the same error when exporting the product using PDE's Product Export Editor.
The Application can be run in the IDE.

Java: 1.7.40
Maven: 3.0.3
Eclipse: 4.3
Re: Maven build fails [message #1118300 is a reply to message #1118277] Fri, 27 September 2013 05:10 Go to previous messageGo to next message
Eclipse UserFriend
The problem is that in Java7 the jfxrt.jar is NOT on the classpath. To
fix this you need to install it into your .m2-repository.

If you look at the pom.xml in releng-project you'll find a comment that
you need to issue to get it installed into local repo (the path might be
different for you!). I think Daniel in another thread mentionned
something about system-dependency but I've never used this myself.

The other option is that you run mvn on JDK8 which has jfxrt.jar on the
classpath but this might cause you other troubles e.g. because the
eclipse compiler does not understand default-methods introduced in
collections, ... .

Tom

On 27.09.13 10:40, Erdal Karaca wrote:
> I am trying to build using maven and getting this error:
>
>
> [ERROR] package test.app;
> [ERROR] ^
> [ERROR] The type javafx.application.Application cannot be resolved. It
> is indire
> ctly referenced from required .class files
> [ERROR] 1 problem (1 error)
>
>
> I have created a simple "OSGi Application Project" using the fx tooling
> on Kepler.
> The get the same error when exporting the product using PDE's Product
> Export Editor.
> The Application can be run in the IDE.
>
> Java: 1.7.40
> Maven: 3.0.3
> Eclipse: 4.3
Re: Maven build fails [message #1118548 is a reply to message #1118300] Fri, 27 September 2013 10:17 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, Tom!

Unfortunately, there is no comment in the releng pom.xml. Excerpt:

					<configuration>
						<encoding>UTF-8</encoding>
						<source>1.7</source>
						<target>1.7</target>
						<extraClasspathElements>
							<extraClasspathElement>
								<groupId>javafx</groupId>
								<artifactId>javafx.mvn</artifactId>
								<version>2.2.0-SNAPSHOT</version> 
							</extraClasspathElement>
						</extraClasspathElements>
					</configuration>



I am using the latest tooling (0.9.0.201309190603) on Kepler.
Re: Maven build fails [message #1118561 is a reply to message #1118548] Fri, 27 September 2013 10:32 Go to previous messageGo to next message
Eclipse UserFriend
Ok - you are right! Looks like i dropped it.

<!-- mvn install:install-file
-Dfile=/Users/tomschindl/Applications/javafx-sdk2.2.0-beta/rt/lib/jfxrt.jar
-DgroupId=javafx -DartifactId=javafx.mvn -Dversion=2.2.0-SNAPSHOT
-Dpackaging=jar -DgeneratePom=true -->

Tom

On 27.09.13 16:17, Erdal Karaca wrote:
> Thanks, Tom!
>
> Unfortunately, there is no comment in the releng pom.xml. Excerpt:
>
>
> <configuration>
> <encoding>UTF-8</encoding>
> <source>1.7</source>
> <target>1.7</target>
> <extraClasspathElements>
> <extraClasspathElement>
> <groupId>javafx</groupId>
> <artifactId>javafx.mvn</artifactId>
> <version>2.2.0-SNAPSHOT</version>
> </extraClasspathElement>
> </extraClasspathElements>
> </configuration>
>
>
>
> I am using the latest tooling (0.9.0.201309190603) on Kepler.
Re: Maven build fails [message #1122008 is a reply to message #1118561] Tue, 01 October 2013 02:22 Go to previous message
Eclipse UserFriend
Tom, thanks for the info. It gave us the right hint. We have now a solution with system dependency that works great and is more self contained because adding javaFX to local repo is not necessary anymore:

<plugin>
	<groupId>org.eclipse.tycho</groupId>
	<artifactId>tycho-compiler-plugin</artifactId>
	<version>${tycho-version}</version>
	<configuration>
		<source>1.7</source>
		<target>1.7</target>
		<!-- add JavaFX to classpath -->
		<extraClasspathElements>
			<extraClasspathElement>
				<groupId>com.oracle</groupId>
				<artifactId>javafx</artifactId>
				<version>2.2.0-SNAPSHOT</version>
				<systemPath>${java.home}/lib/jfxrt.jar</systemPath>
				<scope>system</scope>
			</extraClasspathElement>
		</extraClasspathElements>
	</configuration>
</plugin>


best regards,
Ingo
Previous Topic:JavaFx event locking problems with JRE 7u40
Next Topic:Tutorial 1 fails on Ant Build and is very slow
Goto Forum:
  


Current Time: Wed Apr 23 11:52:34 EDT 2025

Powered by FUDForum. Page generated in 0.03412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top