Is it possible to write in Java 14?

Custom indicators, trading strategies, data export and recording and more...
TheBidWhacker
Posts: 6
Joined: Fri Jul 12, 2019 2:33 pm
Has thanked: 1 time

Is it possible to write in Java 14?

Post by TheBidWhacker » Sat Jun 27, 2020 6:22 pm

I'm a fullstack web programmer who's not super familiar with Java. I've installed the Java 8 JRE/JDK as per the getting started guide here but i'm really longing for some of the features that the newer Java has.

Before I bork my system trying, is it possible to write the plugins in the newest Java and compile down to Java 8 using the "Compiler compliance level" settings in Eclipse?

Ideally i'd like to write in Scala (or even Kotlin) but I think that's going to be down the road.

I would appreciate any tips/tricks/feedback!
Adam

Svyatoslav
Site Admin
Posts: 278
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 31 times

Re: Is it possible to write in Java 14?

Post by Svyatoslav » Sat Jun 27, 2020 7:10 pm

Hi,
You will likely be able to utilize some features using "compiler compliance level", but not all (e.g. classes that are not in Java 8 will not be found in runtime). However, we are transitioning to Java 14 slowly - Mac version already uses it (we were kind of forced to switch due to notarization procedure) and Windows version will get it either in next version (whatever comes after 7.1) or, maybe, even in 7.1 (though considering 7.1 is about to enter feature freeze, we are hesitant about making the change in 7.1, so probably not).

About Scala/Kotlin - we never tried writing a Bookmap plugin using those but I believe you should be able to do it - since all 3 languages compile to same bytecode I don't see any obvious reasons why it would not work.

TheBidWhacker
Posts: 6
Joined: Fri Jul 12, 2019 2:33 pm
Has thanked: 1 time

Re: Is it possible to write in Java 14?

Post by TheBidWhacker » Sat Jun 27, 2020 11:58 pm

Thanks for the quick feedback! That's great to hear you're already on track to upgrade soon. The main features I was wanting to use was `var`, switch expressions, and hopefully records. It seems like those should compile down ok (or at least the first two).

Thanks again!

Post Reply