Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 8 and Java time

I know the default Java library for Codename One is now Java 8 and I am also compiling locally with Java 8.

I am trying to use the new java.time API added in Java 8 (Tutorial). I see the following error at compile time:

: error: package java.time does not exist

Are java.time classes not included in Codename One’s Java 8 port? Should I be using the older Java date instead ? I am not sure if I am missing something.

like image 711
3lix Avatar asked Jan 22 '26 20:01

3lix


1 Answers

Codename One includes a subset of the Java 1.8 classes. I don't think that Java Time classes are included, CN1 has its own classes which are a subset of an earlier Java version (maybe 1.5, I don't recall).

The Javadocs for all the CN1 classes are here: https://www.codenameone.com/javadoc/index.html

like image 125
James H Avatar answered Jan 25 '26 10:01

James H



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!