Write this:
public final class A
{ public static void main( final java.lang.String[] args )
{ B.hello(); }}
public final class B
{ public static void hello()
{ java.lang.System.out.println( "Hello!" ); }}
and save it as "Main.java". Then call:
java Main.java
with a recent JDK. What you have there is a file named
"Main.java" that does /not/ contain a class "Main", and
it has /two/ public classes. Yet, the above command will
happily print,
Hello!
.
On 9/19/19 3:28 PM, Stefan Ram wrote:Not here. I rearranged your source because I prefer opening and closing brackets to align. Here's the result:
Write this:
public final class A { public static void main( final
java.lang.String[] args )
{ B.hello(); }}
public final class B { public static void hello()
{ java.lang.System.out.println( "Hello!" ); }}
and save it as "Main.java". Then call:
java Main.java
with a recent JDK. What you have there is a file named "Main.java"
that does /not/ contain a class "Main", and it has /two/ public
classes. Yet, the above command will happily print,
On Sun, 26 Apr 2020 05:06:48 -0400, Jeff Higgins wrote:
On 9/19/19 3:28 PM, Stefan Ram wrote:
[...] with a recent JDK. [...]
This is using Open Java 1.8 [...]
On Sun, 26 Apr 2020 13:00:20 -0000 (UTC), Martin Gregorie wrote:
On Sun, 26 Apr 2020 05:06:48 -0400, Jeff Higgins wrote:
On 9/19/19 3:28 PM, Stefan Ram wrote:
[...] with a recent JDK. [...]
This is using Open Java 1.8 [...]
Calling 1.8 "recent" is quite a stretch ;)
On Mon, 27 Apr 2020 09:13:59 +0200, Joerg Meier wrote:
On Sun, 26 Apr 2020 13:00:20 -0000 (UTC), Martin Gregorie wrote:True enough, but AFAIK its still supported, alongside 11 and 14, for
On Sun, 26 Apr 2020 05:06:48 -0400, Jeff Higgins wrote:
On 9/19/19 3:28 PM, Stefan Ram wrote:
[...] with a recent JDK. [...]
This is using Open Java 1.8 [...]
Calling 1.8 "recent" is quite a stretch ;)
Fedora Linux.
I recently saw stats (in The Register) showing the majority
of developers are still using 8,
If its just as easy to move from Java 8 to 11 or 14 as it still is to
compile a K&R source file under that latest ANSI C compiler, then I'm
happy to move on, but is it that easy? Somehow I've gotten the impression that it may not be.
Calling 1.8 "recent" is quite a stretch ;)
True enough, but AFAIK its still supported, alongside 11 and 14, for
Fedora Linux. I recently saw stats (in The Register) showing the majority
of developers are still using 8, and #242 is the most recent Java 8
release.
If its just as easy to move from Java 8 to 11 or 14 as it still is to
compile a K&R source file under that latest ANSI C compiler, then I'm
happy to move on, but is it that easy? Somehow I've gotten the impression that it may not be.
--
Martin | martin at
Gregorie | gregorie dot org
On Monday, April 27, 2020 at 8:13:04 AM UTC-4, Martin Gregorie wrote:
Calling 1.8 "recent" is quite a stretch ;)True enough, but AFAIK its still supported, alongside 11 and 14, for
Fedora Linux. I recently saw stats (in The Register) showing the majority
of developers are still using 8, and #242 is the most recent Java 8
release.
If its just as easy to move from Java 8 to 11 or 14 as it still is to
compile a K&R source file under that latest ANSI C compiler, then I'm
happy to move on, but is it that easy? Somehow I've gotten the impression
that it may not be.
I'm using 8 right now. It is easy enough to move from 8 to 11 (when is the next LTS?) but getting government approval?
On 4/27/2020 8:12 AM, Martin Gregorie wrote:
On Mon, 27 Apr 2020 09:13:59 +0200, Joerg Meier wrote:
On Sun, 26 Apr 2020 13:00:20 -0000 (UTC), Martin Gregorie wrote:True enough, but AFAIK its still supported, alongside 11 and 14, for
On Sun, 26 Apr 2020 05:06:48 -0400, Jeff Higgins wrote:
On 9/19/19 3:28 PM, Stefan Ram wrote:
[...] with a recent JDK. [...]
This is using Open Java 1.8 [...]
Calling 1.8 "recent" is quite a stretch ;)
Fedora Linux.
Yes. AdoptOpenJDK will supply updates until May 2026.
https://adoptopenjdk.net/support.html
I recently saw stats (in The Register) showing the majority
of developers are still using 8,
Yes. But a lot of them are in the process of upgrading to 11 now.
If its just as easy to move from Java 8 to 11 or 14 as it still is to
compile a K&R source file under that latest ANSI C compiler, then I'm
happy to move on, but is it that easy? Somehow I've gotten the
impression that it may not be.
Java upgrades are usually pretty easy.
But some can cause a bit of work.
1.4 -> 1.5 was one of them.
8 -> 11 is one of them.
Things to be aware of include:
* if you use unsupported SUN classes then you may need ti
circumvent the module system introduced in Java 9 to get your stuff
to build and run
* if you use JAX-WS or JAXB then that is now a
separate download - it is no longer builtin Java SE
* if you use JavaFX then that is now a
separate download - it is no longer builtin Java SE
* if you use CORBA then you need to find
another implementation
But if you get JAX-WS and JAXB then my guess is that 99.8% of all Java 8
code will work with 11.
On Mon, 27 Apr 2020 08:34:35 -0400, Arne Vajhøj wrote:
On 4/27/2020 8:12 AM, Martin Gregorie wrote:
If its just as easy to move from Java 8 to 11 or 14 as it still is to
compile a K&R source file under that latest ANSI C compiler, then I'm
happy to move on, but is it that easy? Somehow I've gotten the
impression that it may not be.
Java upgrades are usually pretty easy.
But some can cause a bit of work.
1.4 -> 1.5 was one of them.
8 -> 11 is one of them.
Things to be aware of include:
* if you use unsupported SUN classes then you may need ti
circumvent the module system introduced in Java 9 to get your stuff
to build and run
* if you use JAX-WS or JAXB then that is now a
separate download - it is no longer builtin Java SE
* if you use JavaFX then that is now a
separate download - it is no longer builtin Java SE
* if you use CORBA then you need to find
another implementation
But if you get JAX-WS and JAXB then my guess is that 99.8% of all Java 8
code will work with 11.
I don't use any of the gotchas you mention - nothing, really, outside the what was in the 1.6 standard library, apart from some 3rd party stuff:
- the Coco/R syntax generator
- RiverLayout,
- a geodesy package,
- dnsjava,
- mail stuff (jaf ?, javamail, mstor)
- jcharset
- jdbc for PostgreSQL
so it looks as though the move should be straight forward.
8 -> 11 is one of them.
Things to be aware of include:
* if you use unsupported SUN classes then you may need ti
circumvent the module system introduced in Java 9 to
get your stuff to build and run
* if you use JAX-WS or JAXB then that is now a
separate download - it is no longer builtin
Java SE
* if you use JavaFX then that is now a
separate download - it is no longer builtin
Java SE
* if you use CORBA then you need to find
another implementation
But if you get JAX-WS and JAXB then my guess is that 99.8% of all
Java 8 code will work with 11.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 223:33:43 |
Calls: | 6,623 |
Calls today: | 5 |
Files: | 12,171 |
Messages: | 5,318,368 |