Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Tycho build fails using tycho version 1.4.0 with JDK 11

Can we import Jdk related packages into bundle manifest.mf file 

On Fri, Nov 22, 2019 at 5:02 PM Christoph Läubrich <laeubi@xxxxxxxxxxxxxx> wrote:
 > This is new for Java 11

This is not completely true, OSGi has ALWAYS required to import javax.*
packages as least since R4 (I don't have any older spec at hand).
 From R7 on [1] you should even import java.* packages if you target
Java >= 9!

It is just Eclipse PDE[2] that does not respect this and don't complain
about and Equinox (where Eclipse is running) has a
osgi.compatibility.bootdelegation switch[3] to make bundles work that
relies on this behavior. To make things even worse, the default for
equinox is false, but for the equinox launcher executable the default is
true!

So it is true that java 11 is the first JRE where you can't ignore this
issue, but this 'compatibility' should have been removed long time ago.
The sad thing is, because PDE still does not support this (Bug is over
10 years old), people are writing more and more of those code and its
getting harder and harder to remove that.

So if you really want to target Java 9 (and not just compile code with
Java 9 language features) one should upgrade to a R7 compatible
framework, make sure that delegation is not in place and import all
require javax.*/java.* packages in bundle manifest-headers.


[1] https://blog.osgi.org/2018/02/osgi-r7-highlights-java-9-support.html
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=164188
[3]
https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

Am 22.11.19 um 11:48 schrieb Jörg Schaible:
> Your plugins must declare dependencies to the plugins (javax.xml.*)
> containing these classes from the target platform. This is new for Java
> 11, since these classes have been removed from the Java Runtime. This is
> actually the same reason why older Eclipse releases do not run on Java
> 11 - because the plugins do not declare this dependency.
>
> Am Freitag, 22. November 2019, 11:38:36 CET schrieb Sravan K Lakkimsetti:
>
> Hi,
>
> This requires expertise from Tycho team. Hopefully Alex or Michael
> Istria able to help you out.
>
> Thanks
>
> Sravan
>
> From: maragani.veeru <maraganiveera@xxxxxxxxx>
> Sent: 22 November 2019 14:40
> To: Tycho user list <tycho-user@xxxxxxxxxxx>
> Subject: [EXTERNAL] Re: [tycho-user] Tycho build fails using tycho
> version 1.4.0 with JDK 11
>
> Ok thanks that was resolved ,but i am facing one issue.
>
> Actually in my plugins code i used one dependency java.xml from Jdk-11
> ,but when am trying to build the plugins with tycho it is giving the
> compilations errors ,because tycho is not able to find that dependency
> from JDK ,how can we make it available that java.xml from JDK-11 in
> build process ?
>
> Can you please let me know.
>
> BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time:  05:14 min
> [INFO] Finished at: 2019-11-22T14:34:15+05:30
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.eclipse.tycho:tycho-compiler-plugin:1.5.1:compile (default-compile)
> on project com.spacetimeinsight.sistudio.common.model: Compilation
> failure: Compilation failure:
> [ERROR]
> C:\Users\maragani\git\SIStudio-Java11\com.spacetimeinsight.sistudio.common.model\src\com\spacetimeinsight\sistudio\model\emf\util\XMLPersistenceMappingLoadImpl.java:[5]
>
> [ERROR] import javax.xml.parsers.ParserConfigurationException;
> [ERROR]       ^^^^^^^^^^^^^^^^^
> [ERROR] The package javax.xml.parsers is accessible from more than one
> module: <unnamed>, java.xml
> [ERROR]
> C:\Users\maragani\git\SIStudio-Java11\com.spacetimeinsight.sistudio.common.model\src\com\spacetimeinsight\sistudio\model\emf\util\XMLPersistenceMappingLoadImpl.java:[6]
>
> [ERROR] import javax.xml.parsers.SAXParser;
> [ERROR]       ^^^^^^^^^^^^^^^^^
> [ERROR] The package javax.xml.parsers is accessible from more than one
> module: <unnamed>, java.xml
> [ERROR]
> C:\Users\maragani\git\SIStudio-Java11\com.spacetimeinsight.sistudio.common.model\src\com\spacetimeinsight\sistudio\model\emf\util\XMLPersistenceMappingLoadImpl.java:[7]
>
> [ERROR] import javax.xml.parsers.SAXParserFactory;
> [ERROR]       ^^^^^^^^^^^^^^^^^
> [ERROR] The package javax.xml.parsers is accessible from more than one
> module: <unnamed>, java.xml
> [ERROR]
> C:\Users\maragani\git\SIStudio-Java11\com.spacetimeinsight.sistudio.common.model\src\com\spacetimeinsight\sistudio\model\emf\util\XMLPersistenceMappingLoadImpl.java:[11]
>
> [ERROR] import org.xml.sax.SAXException;
>
> On Fri, Nov 22, 2019 at 12:22 PM Sravan K Lakkimsetti
> <sravankumarl@xxxxxxxxxx <mailto:sravankumarl@xxxxxxxxxx>> wrote:
>
> Hi,
>
> Latest version of Tycho is 1.5.1 and at eclipse platform project we use
> it with Java 11. Can you try Tycho version 1.5.1?
>
> Thanks
>
> Sravan
>
> From: maragani.veeru <maraganiveera@xxxxxxxxx
> <mailto:maraganiveera@xxxxxxxxx>>
> Sent: 21 November 2019 11:18
> To: Tycho user list <tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>>
> Subject: [EXTERNAL] [tycho-user] Tycho build fails using tycho version
> 1.4.0 with JDK 11
>
> Hi ,
>
> Recently i upgraded all my target platform plugins to latest like the
> above attached file.
>
> When i am trying to build the plugins with tycho version 1.4.0 with JDK
> 11, i am facing the below error ,
> can you please let me know the problem.
>
>
>
> [INFO] Scanning for projects...
> [ERROR] Internal error: de.pdark.decentxml.XMLParseException: Line 2416,
> column 4: Expected '<!--' -> [Help 1]
> org.apache.maven.InternalErrorException: Internal error:
> de.pdark.decentxml.XMLParseException: Line 2416, column 4: Expected '<!--'
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:120)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
> Caused by: de.pdark.decentxml.XMLParseException: Line 2416, column 4:
> Expected '<!--'
> at de.pdark.decentxml.XMLTokenizer.parseComment(XMLTokenizer.java:454)
> at de.pdark.decentxml.XMLTokenizer.parseExcalamation(XMLTokenizer.java:372)
> at
> de.pdark.decentxml.XMLTokenizer.parseBeginSomething(XMLTokenizer.java:305)
> at de.pdark.decentxml.XMLTokenizer.next(XMLTokenizer.java:235)
> at de.pdark.decentxml.XMLParser.parseElementContent(XMLParser.java:835)
> at de.pdark.decentxml.XMLParser.parseElement(XMLParser.java:821)
> at de.pdark.decentxml.XMLParser.parse(XMLParser.java:159)
> at org.eclipse.tycho.model.Feature.read(Feature.java:213)
> at org.eclipse.tycho.model.Feature.read(Feature.java:208)
> at org.eclipse.tycho.model.Feature.loadFeature(Feature.java:266)
> at
> org.eclipse.tycho.core.osgitools.EclipseFeatureProject.setupProject(EclipseFeatureProject.java:53)
> at
> org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:75)
> at
> org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:264)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
> ... 11 more
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
>
> Thanks,
>
> Veera
>
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/tycho-user
>
>
>
>
>
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/tycho-user
>
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/tycho-user

Back to the top