Page 1 of 1

Moving from Java 8 to Java 11

PostPosted: 19 Jul 2019, 07:36
by Jastiv
I want to fix my game editor so it works with Java 11, it is broke in Java 11 although in compiles and runs with java 8 because of variables, but I don't know where to begin to fix it.
I have all this stuff I need to fix, and no idea where to start.
I already know about SDKman and Intelij IDE.
So, any help would be appreciated (tutorials, where to start on a project like that, how to replace variables.
Else I fear I will be spending years and looking at irrelevant stuff and by that time it will be Java 15!

Re: Moving from Java 8 to Java 11

PostPosted: 19 Jul 2019, 08:22
by fluffrabbit
AFAIK Java 11 is 64-bit while Java 8 is 32-bit, though I could be way off. Anyhow that could definitely affect the size of things, for instance ints.

Re: Moving from Java 8 to Java 11

PostPosted: 19 Jul 2019, 15:17
by dulsi
Does it not compile under Java 11? Do you have the error messages or are no looking for specific help and just want generally information on updating code?

Re: Moving from Java 8 to Java 11

PostPosted: 19 Jul 2019, 18:14
by Jastiv
ant
Buildfile: /home/lori/Wogralddev/wograldgit/wograld-gitcode/javaeditor/trunk/build.xml

compile-utils:
[mkdir] Created dir: /home/lori/Wogralddev/wograldgit/wograld-gitcode/javaeditor/trunk/dest/utils/app
[javac] Compiling 35 source files to /home/lori/Wogralddev/wograldgit/wograld-gitcode/javaeditor/trunk/dest/utils/app
[javac] warning: [options] bootstrap class path not set in conjunction with -source 6
[javac] error: Source option 6 is no longer supported. Use 7 or later.
[javac] error: Target option 6 is no longer supported. Use 7 or later.

BUILD FAILED
/home/lori/Wogralddev/wograldgit/wograld-gitcode/javaeditor/trunk/build.xml:604: Compile failed; see the compiler error output for details.

Total time: 0 seconds

Its is a lot. I have no idea how to move from basic things like hello world, to updating a language to work with a whole new compiler. I don't even know where to look for compiler error output.

Re: Moving from Java 8 to Java 11

PostPosted: 19 Jul 2019, 20:13
by fluffrabbit
It looks like the build flags are wrong. Either build.xml or build.properties (I think that's what it's called) is specifying a Java 6 target while Java 11 may not target versions that far back. Assuming Java is backwards-compatible, just increase the number from 6 to whichever version of Java you think should be the minimum.

Java has fallen out of favor and it's also notoriously hard to learn. But there's no better way to learn than by doing.

Re: Moving from Java 8 to Java 11

PostPosted: 20 Jul 2019, 14:12
by dulsi
In build.xml, I think you just need to change build.source.version.

Re: Moving from Java 8 to Java 11

PostPosted: 24 Jul 2019, 19:02
by Ntech
I hate it when languages change (why do they feel the need), for example, I regret the push to Python 3 from Python 2.7.

Anyway, this may be helpful: https://codete.com/blog/java-8-java-11-quick-guide/