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


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

Java 9

Started byEric Douglas <e.d.programmer@gmail.com>
First post2018-01-25 13:03 -0800
Last post2018-01-26 15:18 +0000
Articles 12 — 6 participants

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


Contents

  Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-25 13:03 -0800
    Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-25 13:10 -0800
      Re: Java 9 Arne Vajhøj <arne@vajhoej.dk> - 2018-01-25 20:16 -0500
        Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 06:43 -0800
    Re: Java 9 Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-01-25 17:09 -0500
      Re: Java 9 Arne Vajhøj <arne@vajhoej.dk> - 2018-01-25 20:00 -0500
      Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 06:16 -0800
        Re: Java 9 Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-01-26 09:37 -0500
    Re: Java 9 Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-25 17:23 -0600
      Re: Java 9 Hiram Hunt <hiramhunt@verizon.net> - 2018-01-26 08:31 -0500
        Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 06:06 -0800
          Re: Java 9 Kiwi User <martin@mydomain.invalid> - 2018-01-26 15:18 +0000

#37997 — Java 9

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-25 13:03 -0800
SubjectJava 9
Message-ID<31ae5b61-c6df-4c97-91e7-c33fa9571822@googlegroups.com>
First, when does Java 9 go mainstream?  Anyone just looking for a JRE to run a Java based app will go to https://java.com/en/download/ which currently still downloads 8.

Second, how do I get my code to compile?  I swear I had my code compiling on 9 before so maybe I added code after that, since I'm doing my normal development on 8 because we're integrating to an API that doesn't support 9 yet.  I need to either find a dependency to add, change my code to not need the dependency, or get the source from the Oracle methods packaged into Java 8 and just paste it into my API.

I'm looking for
sun.swing.SwingUtilities2.liesInVertical(Rectangle rect, Point p, boolean three)
sun.swing.SwingUtilities2.getTreePath(TreeModelEvent event, TreeModel model)

and org.w3c.dom classes for use with batik's SVG generator.

[toc] | [next] | [standalone]


#37998

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-25 13:10 -0800
Message-ID<c589f66d-9076-4bb5-9839-f2e9c08d1199@googlegroups.com>
In reply to#37997
On Thursday, January 25, 2018 at 4:04:12 PM UTC-5, Eric Douglas wrote:
> 
> I'm looking for
> sun.swing.SwingUtilities2.liesInVertical(Rectangle rect, Point p, boolean three)
> sun.swing.SwingUtilities2.getTreePath(TreeModelEvent event, TreeModel model)
> 
> and org.w3c.dom classes for use with batik's SVG generator.

SwingUtilities2 is not available in JDK 9, and I can't find it anywhere other than rt.jar from Java 8.
The error on the dom is actually "The package org.w3c.dom is accessible from more than one module"

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


#38002

FromArne Vajhøj <arne@vajhoej.dk>
Date2018-01-25 20:16 -0500
Message-ID<p4dvh9$n10$1@gioia.aioe.org>
In reply to#37998
On 1/25/2018 4:10 PM, Eric Douglas wrote:
> On Thursday, January 25, 2018 at 4:04:12 PM UTC-5, Eric Douglas wrote:
>> I'm looking for
>> sun.swing.SwingUtilities2.liesInVertical(Rectangle rect, Point p, boolean three)
>> sun.swing.SwingUtilities2.getTreePath(TreeModelEvent event, TreeModel model)
>>
>> and org.w3c.dom classes for use with batik's SVG generator.
> 
> SwingUtilities2 is not available in JDK 9, and I can't find it anywhere other than rt.jar from Java 8.

My Java 8 gives me:

"warning: SwingUtilities2 is internal proprietary API and may be removed 
in a future release"

Look like they meant that!

:-)

If you want the Java 8 behavior in Java 9 then you can use:

javac --add-exports java.desktop/sun.swing=ALL-UNNAMED ...
java --add-exports java.desktop/sun.swing=ALL-UNNAMED ...

But maybe you should rewrite.

> The error on the dom is actually "The package org.w3c.dom is accessible from more than one module"

How does the code that gives this error look like?

Arne

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


#38007

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-26 06:43 -0800
Message-ID<b7b4ebd6-7809-42dd-8f12-14ad35ee96b6@googlegroups.com>
In reply to#38002
On Thursday, January 25, 2018 at 8:16:40 PM UTC-5, Arne Vajhøj wrote:
> > The error on the dom is actually "The package org.w3c.dom is accessible from more than one module"
> 
> How does the code that gives this error look like?
> 
> Arne

I simply tried to switch Eclipse project settings from JDK 8 compliance to 9 so perhaps the default setup for modules is wrong?  I can have multiple jars in a module and it sets each jar as it's own module by default?  I took a closer look at these error messages and they wouldn't make sense otherwise.  Some packages do have the same package names in different jars with different classes ie this error:
The package org.apache.http is accessible from more than one module: httpclient, httpcore

I must not have noticed yesterday the rest of the w3c error which lists it's modules.
The package org.w3c.dom is accessible from more than one module: batik.all, java.xml, xml.apis.ext

Like why does it care where the package may be referenced if there's no class conflict?

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


#37999

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2018-01-25 17:09 -0500
Message-ID<p4dkjf$dtc$1@dont-email.me>
In reply to#37997
On 1/25/2018 4:03 PM, Eric Douglas wrote:
> First, when does Java 9 go mainstream?  Anyone just looking for a JRE to run a Java based app will go to https://java.com/en/download/ which currently still downloads 8.
> 
> Second, how do I get my code to compile?  I swear I had my code compiling on 9 before so maybe I added code after that, since I'm doing my normal development on 8 because we're integrating to an API that doesn't support 9 yet.  I need to either find a dependency to add, change my code to not need the dependency, or get the source from the Oracle methods packaged into Java 8 and just paste it into my API.
> 
> I'm looking for
> sun.swing.SwingUtilities2.liesInVertical(Rectangle rect, Point p, boolean three)
> sun.swing.SwingUtilities2.getTreePath(TreeModelEvent event, TreeModel model)

     If you're calling these methods from your own code, you have been
sinning and are now receiving your punishment.  See

    <http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html>

     Two courses of action seem plausible if this is the case: To remove
the not-part-of-official-Java stuff from your code and rely on the
"published" API's instead, or to hope there's a SwingUtilities3 (?)
package with methods not too dissimilar to those you've been (ab)using.
The first is certainly preferable if you can, er, swing it, since it
leaves you less exposed to breakage in future Java versions (and allows
you to use non-Oracle Java implementations, too).  The second, if it
works at all, is at best an ugly hack.

     If you're calling "published" Java API's and they in turn use
these Oracle-private packages, that's another matter, and the error
most likely has something to do with a bollixed configuration.  I don't
have any suggestions for this case, unfortunately.

-- 
esosman@comcast-dot-net.invalid
One thousand ninety-one days to go.

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


#38001

FromArne Vajhøj <arne@vajhoej.dk>
Date2018-01-25 20:00 -0500
Message-ID<p4dujt$lue$1@gioia.aioe.org>
In reply to#37999
On 1/25/2018 4:03 PM, Eric Douglas wrote:
> First, when does Java 9 go mainstream?  Anyone just looking for a JRE 
> to run a Java based app will go to https://java.com/en/download/ which 
> currently still downloads 8.

Java 9 was released almost a half year ago (September 21st). I would
say that it is mainstream.

I have no idea why https://java.com/en/download/ still point to 8.

https://java.sun.com/ redirecting to 
http://www.oracle.com/technetwork/java/index.html has 9 (9.0.4).

Maybe they simply forgot.

Or someone decided that since applets became deprecated in Java 9, then
a site geared towards applets should stay on 8.

Regarding when the majority of users actually make the switch, then my
feeling is that:
* pure Java SE users switch 6-18 months after release, they want to see
   the most severe bugs found and fixed, and then they need to do some
   test as part of a regular release
* Java EE users switch 1-4 years after release [some may even wait
   longer, but in that case they may skip a version], the process is way
   longer because first the app server vendor need to support the
   new version, and then they need to test as part of a release -
   and releases in the server world are often less frequent than
   releases in desktop world

Arne



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


#38005

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-26 06:16 -0800
Message-ID<6aff8e7d-ee30-4d2f-b715-92da9c64a0be@googlegroups.com>
In reply to#37999
On Thursday, January 25, 2018 at 5:10:09 PM UTC-5, Eric Sosman wrote:
>      If you're calling these methods from your own code, you have been
> sinning and are now receiving your punishment.  See
> 
>     <http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html>
> 
>      Two courses of action seem plausible if this is the case: To remove
> the not-part-of-official-Java stuff from your code and rely on the
> "published" API's instead, or to hope there's a SwingUtilities3 (?)
> package with methods not too dissimilar to those you've been (ab)using.
> The first is certainly preferable if you can, er, swing it, since it
> leaves you less exposed to breakage in future Java versions (and allows
> you to use non-Oracle Java implementations, too).  The second, if it
> works at all, is at best an ugly hack.
> 
>      If you're calling "published" Java API's and they in turn use
> these Oracle-private packages, that's another matter, and the error
> most likely has something to do with a bollixed configuration.  I don't
> have any suggestions for this case, unfortunately.
> 

As far as I could tell there were no published APIs for the methods I needed.  For instance I wrote an extension of a JTree but needed to customize the drop locations.  I could only see 3 ways to do that, 1) call JTree.dropLocationForPoint and work with whatever it returns, 2) do what they're doing to determine whether to drop above or below and call SwingUtilities2.liesInVertical, or 3) find source for SwingUtilities2 not included with JDK install and copy and paste the code from that method.
I can google the source to paste in what they're doing as my own methods from a site like this.
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/sun/swing/SwingUtilities2.java

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


#38006

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2018-01-26 09:37 -0500
Message-ID<p4fefb$s18$1@dont-email.me>
In reply to#38005
On 1/26/2018 9:16 AM, Eric Douglas wrote:
> On Thursday, January 25, 2018 at 5:10:09 PM UTC-5, Eric Sosman wrote:
>>       If you're calling these methods from your own code, you have been
>> sinning and are now receiving your punishment.  See
>>
>>      <http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html>
>>
>>       Two courses of action seem plausible if this is the case: To remove
>> the not-part-of-official-Java stuff from your code and rely on the
>> "published" API's instead, or to hope there's a SwingUtilities3 (?)
>> package with methods not too dissimilar to those you've been (ab)using.
>> The first is certainly preferable if you can, er, swing it, since it
>> leaves you less exposed to breakage in future Java versions (and allows
>> you to use non-Oracle Java implementations, too).  The second, if it
>> works at all, is at best an ugly hack.
>>  [...]
> 
> As far as I could tell there were no published APIs for the methods I needed.  [...]

     Then you'll have to keep maintaining an ugly hack, and keep
on dealing with version-to-version (and vendor-to-vendor) breakage.
It's up to you to weigh the advantages of non-portable code against
the ongoing maintenance cost; I don't think anyone here is in a
position to evaluate the tradeoffs on your behalf.

-- 
esosman@comcast-dot-net.invalid
One thousand ninety days to go.

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


#38000

FromKnute Johnson <nospam@rabbitbrush.frazmtn.com>
Date2018-01-25 17:23 -0600
Message-ID<p4dotl$95l$1@dont-email.me>
In reply to#37997
On 1/25/2018 3:03 PM, Eric Douglas wrote:
> First, when does Java 9 go mainstream?

9 is the current Java version.  10 is due out this spring.

I always go to java.sun.com which now forwards to 
http://www.oracle.com/technetwork/java/index.html for my Java downloads.

knute

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


#38003

FromHiram Hunt <hiramhunt@verizon.net>
Date2018-01-26 08:31 -0500
Message-ID<55GaC.451668$oY6.2619@fx26.iad>
In reply to#38000
On 1/25/2018 6:23 PM, Knute Johnson wrote:
> On 1/25/2018 3:03 PM, Eric Douglas wrote:
>> First, when does Java 9 go mainstream?
> 
> 9 is the current Java version.  10 is due out this spring.
> 
> I always go to java.sun.com which now forwards to 
> http://www.oracle.com/technetwork/java/index.html for my Java downloads.
> 
> knute

I used to do that, then I realized that java.oracle.com
would probably work.  It does.

--
Hiram Hunt (hiramhunt@verizon.net)

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


#38004

FromEric Douglas <e.d.programmer@gmail.com>
Date2018-01-26 06:06 -0800
Message-ID<42b94cf7-0c7b-4f53-b140-47db54208d1e@googlegroups.com>
In reply to#38003
On Friday, January 26, 2018 at 8:32:03 AM UTC-5, Hiram Hunt wrote:
> I used to do that, then I realized that java.oracle.com
> would probably work.  It does.
> 
> --

I always download my Java from http://www.oracle.com/technetwork/java/javase/downloads/index.html only because I normally need the JDK.  If an end user would install Java on their own to run a Java app they would likely google "Java download" for which the first result is https://java.com/en/download/ which is currently on 8u161.

Each new version is supposed to have security updates, so I'm not sure how important they are, how soon we need to be installing updates.  It is a bit of a hassle to update servers as it takes a few minutes and must be done when no one is running our application, so my live server is still on 8u121 while my test server and local machine are up to 144, and it hasn't been easy setting up network deployment so some of our client machines are on 8u101. The 161/162 is pretty new, as I got some tablets recently and downloaded the latest and they're on u151.  I thought new versions were supposed to be stable and everyone was supposed to install them asap which was a big deal one year with a major security issue, but the latest is currently buggy (https://bugs.openjdk.java.net/browse/JDK-8196011).

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


#38008

FromKiwi User <martin@mydomain.invalid>
Date2018-01-26 15:18 +0000
Message-ID<p4fgrq$htv$1@news.albasani.net>
In reply to#38004
On Fri, 26 Jan 2018 06:06:54 -0800, Eric Douglas wrote:

Another datapoint. When I upgraded my systems to Fedora 27 Linux late 
last year I also switched to using OpenJDK Java, None of my Java 
applications have been upgraded or recompiled all and have continued to 
run without any problems. I'm using a mix of command-line and Swing Java 
applications, some use JDBC to access PostgreSQL databases.

The current release is openjdk version "1.8.0_151"


-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [standalone]


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


csiph-web