Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38991 > unrolled thread

How do I compile my Java 8 SE code with OpenJDK 11?

Started byEric Douglas <e.d.programmer@gmail.com>
First post2019-07-03 12:13 -0700
Last post2019-07-15 21:49 -0400
Articles 10 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  How do I compile my Java 8 SE code with OpenJDK 11? Eric Douglas <e.d.programmer@gmail.com> - 2019-07-03 12:13 -0700
    Re: How do I compile my Java 8 SE code with OpenJDK 11? Eric Douglas <e.d.programmer@gmail.com> - 2019-07-03 13:49 -0700
      Re: How do I compile my Java 8 SE code with OpenJDK 11? Arne Vajhøj <arne@vajhoej.dk> - 2019-07-03 22:01 -0400
      Re: How do I compile my Java 8 SE code with OpenJDK 11? Eric Douglas <e.d.programmer@gmail.com> - 2019-07-05 06:26 -0700
        Re: How do I compile my Java 8 SE code with OpenJDK 11? Andreas Leitgeb <avl@logic.at> - 2019-08-02 07:00 +0000
          Re: How do I compile my Java 8 SE code with OpenJDK 11? Eric Douglas <e.d.programmer@gmail.com> - 2019-08-02 05:42 -0700
    Re: How do I compile my Java 8 SE code with OpenJDK 11? Andrew J <aj@f-m.fm> - 2019-07-04 01:45 -0400
      Re: How do I compile my Java 8 SE code with OpenJDK 11? Knute Johnson <groups@585ranch.com> - 2019-07-13 14:46 -0500
        Re: How do I compile my Java 8 SE code with OpenJDK 11? Eric Douglas <e.d.programmer@gmail.com> - 2019-07-15 07:09 -0700
          Re: How do I compile my Java 8 SE code with OpenJDK 11? Arne Vajhøj <arne@vajhoej.dk> - 2019-07-15 21:49 -0400

#38991 — How do I compile my Java 8 SE code with OpenJDK 11?

FromEric Douglas <e.d.programmer@gmail.com>
Date2019-07-03 12:13 -0700
SubjectHow do I compile my Java 8 SE code with OpenJDK 11?
Message-ID<19942fd8-6ea3-457f-ac8b-3dab01a5ba37@googlegroups.com>
Issues:
1) How to reference javafx?
2) How to reference javax.xml.soap?
3) How to reference javax.xml.bind?
4) How to resolve error message "The package org.w3c.dom is accessible from more than one module: batik.all, java.xml, xml.apis.ext"?

[toc] | [next] | [standalone]


#38992

FromEric Douglas <e.d.programmer@gmail.com>
Date2019-07-03 13:49 -0700
Message-ID<8985be4f-fd7c-4aa9-ad89-bfeca7410555@googlegroups.com>
In reply to#38991
On Wednesday, July 3, 2019 at 3:13:25 PM UTC-4, Eric Douglas wrote:
> Issues:
> 1) How to reference javafx?
> 2) How to reference javax.xml.soap?
> 3) How to reference javax.xml.bind?
> 4) How to resolve error message "The package org.w3c.dom is accessible from more than one module: batik.all, java.xml, xml.apis.ext"?

ok that took some doing but I worked out all the red x's, now to just update a few deprecated method references.
I had to

download java fx (https://gluonhq.com/products/javafx/)

download soap (https://search.maven.org/search?q=g:javax.xml.soap%20AND%20a:javax.xml.soap-api)

download bind (https://search.maven.org/search?q=g:com.sun.xml.bind%20AND%20a:jaxb-jxc)

Remove a reference to an old batik-all jar and download a newer batik

and change the path reference to org.apache.batik.anim.dom.SVGDOMImplementation

Everything compiles now with all these jar updates, now to clear up a few deprecated method references.
I'm surprised the switch to OpenJDK 11 was even this easy.  I tested with the latest available Eclipse soon after Java SE 9 was available and got all kinds of headaches.  This Eclipse 2019-06 has a modules and a classpath on the build tab.  I believe when I first tested it with 9 it tried to make everything into modules.

[toc] | [prev] | [next] | [standalone]


#38993

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-07-03 22:01 -0400
Message-ID<qfjml5$k54$1@gioia.aioe.org>
In reply to#38992
On 7/3/2019 4:49 PM, Eric Douglas wrote:
> On Wednesday, July 3, 2019 at 3:13:25 PM UTC-4, Eric Douglas wrote:
>> Issues:
>> 1) How to reference javafx?
>> 2) How to reference javax.xml.soap?
>> 3) How to reference javax.xml.bind?
>> 4) How to resolve error message "The package org.w3c.dom is accessible from more than one module: batik.all, java.xml, xml.apis.ext"?
> 
> ok that took some doing but I worked out all the red x's, now to just update a few deprecated method references.
> I had to
> 
> download java fx (https://gluonhq.com/products/javafx/)
> 
> download soap (https://search.maven.org/search?q=g:javax.xml.soap%20AND%20a:javax.xml.soap-api)
> 
> download bind (https://search.maven.org/search?q=g:com.sun.xml.bind%20AND%20a:jaxb-jxc)
> 
> Remove a reference to an old batik-all jar and download a newer batik
> 
> and change the path reference to org.apache.batik.anim.dom.SVGDOMImplementation
> 
> Everything compiles now with all these jar updates, now to clear up a few deprecated method references.

You can also get JAX-WS and JAXM from Github.

I have links at 
http://external.vajhoej.dk:81/arne/articles/javaupdate.html#11rem ...

Arne

[toc] | [prev] | [next] | [standalone]


#38999

FromEric Douglas <e.d.programmer@gmail.com>
Date2019-07-05 06:26 -0700
Message-ID<c3d43915-d5fb-4858-b48d-cbe59052534a@googlegroups.com>
In reply to#38992
On Wednesday, July 3, 2019 at 4:50:08 PM UTC-4, Eric Douglas wrote:
> Everything compiles now with all these jar updates, now to clear up a few deprecated method references.


Now the only compile issue I have left is with deprecation, how to convert a class which is using Observer and Observable.

[toc] | [prev] | [next] | [standalone]


#39061

FromAndreas Leitgeb <avl@logic.at>
Date2019-08-02 07:00 +0000
Message-ID<slrnqk7nro.36g.avl@logic.at>
In reply to#38999
Eric Douglas <e.d.programmer@gmail.com> wrote:
> On Wednesday, July 3, 2019 at 4:50:08 PM UTC-4, Eric Douglas wrote:
>> Everything compiles now with all these jar updates, now to clear up a
>> few deprecated method references.
> Now the only compile issue I have left is with deprecation, how to convert
> a class which is using Observer and Observable.

So far it is just a deprecation.  If your legacy code needs it,
then just ignore or silence these deprecation warnings.

https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Observable.html

has a paragraph on reasons for deprecation and alternatives.

If Observable really and exactly fits your bill in your code, and
you want your code to last beyond the eventual removal, then write
and use your own.

[toc] | [prev] | [next] | [standalone]


#39062

FromEric Douglas <e.d.programmer@gmail.com>
Date2019-08-02 05:42 -0700
Message-ID<c1f87764-43e7-4fa2-84eb-0574a8dcf392@googlegroups.com>
In reply to#39061
On Friday, August 2, 2019 at 3:00:19 AM UTC-4, Andreas Leitgeb wrote:
convert
> > a class which is using Observer and Observable.
> 
> So far it is just a deprecation.  If your legacy code needs it,
> then just ignore or silence these deprecation warnings.
> 

I did just convert that to a simple listener interface I believe works as expected.
I think I was expecting Observable to work better with multiple threads?

[toc] | [prev] | [next] | [standalone]


#38994

FromAndrew J <aj@f-m.fm>
Date2019-07-04 01:45 -0400
Message-ID<qfk3pq$ue1$1@dont-email.me>
In reply to#38991
Eric Douglas wrote:
> Issues:
> 1) How to reference javafx?
> 2) How to reference javax.xml.soap?
> 3) How to reference javax.xml.bind?
> 4) How to resolve error message "The package org.w3c.dom is accessible from more than one module: batik.all, java.xml, xml.apis.ext"?
> 

Java 11 removed JavaFX and JAX-WS (which includes javax.xml.soap and 
javax.xml.bind).  There are a couple options, and slightly different 
depending on JavaFX vs JAX-WS:

  - For JavaFX alone, the easiest way I know of is to switch to the 
Liberica JDK, which includes JavaFX.  You can download it at 
https://bell-sw.com/.  I've successfully tested its Java 11 release with 
my JavaFX programs.
  - For JAX-WS, it looks like you can add it as a Maven dependency:
<dependency>
   <groupId>com.sun.xml.ws</groupId>
   <artifactId>jaxws-ri</artifactId>
   <version>2.3.2</version>
   <type>pom</type>
</dependency>
I haven't used JAX-WS, so I can't vouch that that is the only artifactId 
you will need.
  - For JavaFX with the OpenJDK, or other JDKs that don't include it, 
you'll need to use Maven/Gradle/etc. to pull in OpenJFX as a dependency, 
with groupId org.openjfx and artifactId javafx-maven-plugin.  I've done 
this once with success.  There is documentation at 
https://openjfx.io/openjfx-docs/, although it looks like you'll have to 
refer to Maven Central for the right version.  I've done this once but 
it was last year, and I'm rusty on the nuances of it.

I am not sure about the 4th issue, as I haven't switched to the module 
system, and haven't run into that one yet.

Hope this helps!

AJ

[toc] | [prev] | [next] | [standalone]


#39001

FromKnute Johnson <groups@585ranch.com>
Date2019-07-13 14:46 -0500
Message-ID<qgdcek$do3$1@dont-email.me>
In reply to#38994
On 7/4/2019 12:45 AM, Andrew J wrote:
>   - For JavaFX alone, the easiest way I know of is to switch to the 
> Liberica JDK, which includes JavaFX.  You can download it at 
> https://bell-sw.com/.  I've successfully tested its Java 11 release with 
> my JavaFX programs.
> 
> AJ

I've been using the Azul 11 JDK with JavaFX.  I've been very happy with 
that one so far.

https://www.azul.com/downloads/zulu/

knute...

[toc] | [prev] | [next] | [standalone]


#39002

FromEric Douglas <e.d.programmer@gmail.com>
Date2019-07-15 07:09 -0700
Message-ID<7f2ae5a1-2725-47f8-8b4b-6a785f4e2ff9@googlegroups.com>
In reply to#39001
On Saturday, July 13, 2019 at 3:46:38 PM UTC-4, Knute Johnson wrote:
> I've been using the Azul 11 JDK with JavaFX.  I've been very happy with 
> that one so far.
> 
> https://www.azul.com/downloads/zulu/
> 
> knute...

Great so now there's a Zulu Java?  Does every Java API compile on everyone's JDK or do we have to keep making changes if you migrate an API to another version?  How many versions will there be now?

We have the dropping support but free forever Java 8 SE u202 from Oracle
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
The current Oracle Java for testing only unless you have an Oracle license.
https://www.oracle.com/technetwork/java/javase/downloads/index.html
OpenJDK HotSpot (the main one now supported by our Java-base language vendor)
https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot
OpenJDK OpenJ9 (claims faster than HotSpot but apparently missing some key features)
https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=openj9
jdk.java.net (claims is from Oracle, not sure what this is about)
http://jdk.java.net/
Liberica JDK??
https://bell-sw.com/
and now a Zulu JDK
https://www.azul.com/downloads/zulu-community/

Any chart somewhere on how many versions there are, who maintains them, and why anyone should choose one over the others?

Then for the Webstart they say you can just copy the javaws from the Oracle 8 SE u202 and continue to use for free, or there's https://adoptopenjdk.net/icedtea-web.html or there's https://openwebstart.com/

So many options.  Now with Java 8 SE we always wanted to disabled the Java Auto-updater on our domain and push out new versions so we could test them first.  We tried to do this with group policy but kept messing it up, we still have some machines running Java 8 u101.  Now with the new versions there's new ways to make sure every end user has the correct version installed, need to figure out.

[toc] | [prev] | [next] | [standalone]


#39003

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-07-15 21:49 -0400
Message-ID<qgjaf1$ej7$1@gioia.aioe.org>
In reply to#39002
On 7/15/2019 10:09 AM, Eric Douglas wrote:
> On Saturday, July 13, 2019 at 3:46:38 PM UTC-4, Knute Johnson wrote:
>> I've been using the Azul 11 JDK with JavaFX.  I've been very happy with
>> that one so far.
>>
>> https://www.azul.com/downloads/zulu/
> 
> Great so now there's a Zulu Java?  Does every Java API compile on everyone's JDK or do we have to keep making changes if you migrate an API to another version?  How many versions will there be now?
> 
> We have the dropping support but free forever Java 8 SE u202 from Oracle
> https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
> The current Oracle Java for testing only unless you have an Oracle license.
> https://www.oracle.com/technetwork/java/javase/downloads/index.html
> OpenJDK HotSpot (the main one now supported by our Java-base language vendor)
> https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot
> OpenJDK OpenJ9 (claims faster than HotSpot but apparently missing some key features)
> https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=openj9
> jdk.java.net (claims is from Oracle, not sure what this is about)
> http://jdk.java.net/
> Liberica JDK??
> https://bell-sw.com/
> and now a Zulu JDK
> https://www.azul.com/downloads/zulu-community/
> 
> Any chart somewhere on how many versions there are, who maintains them, and why anyone should choose one over the others?

It is actually not that complicated.

There is the open source OpenJDK project that maintain the reference
version of Java.

There are then a large number of builds based on that code:
* jdk.java.net
* AdoptOpenJDK
* Azul Zulu
etc.

They are all build from OpenJDK source, so same code. Just different
packaging and maybe some extra's *outside* of Java SE.

Then there are the commecial Java's:
* Oracle
* IBM
etc.

Oracle Java share almost all code with OpenJDK, but do come with
a few extras.

IBM supposedly get code from Oracle but replaced a few pieces with
their own code including a new JVM.

And Java is standardized. So if you use only documented features
of Java version X then any Java X implementation should work.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web