I’d like to launch my projects on Android, but unfortunately, I understand the Android mode isn’t compatible with Java 17. Are there any solutions?
Hello,
I see a related topic here:
I asked ChatGPT your question and it responded:
Have you considered using Android Studio directly and just using Processing as a library?
I will not be trying this anytime soon but have used Android Studio in the past with Processing libraries just as I have used other IDEs with the Processing library.
Any response from an AI such as ChatGPT needs to be scrutinized.
:)
Is there any documentation for this assumption? I’ve been unable to find this documented anywhere. Which jdk are you using on which operating system? Would it be possible to post test android code which fails because of this?
For whatever it’s worth here is the jdk that my macos system is using (it’s well past 17):
% java --version
openjdk 24.0.1 2025-04-15
OpenJDK Runtime Environment Zulu24.30+13-CA (build 24.0.1+9)
OpenJDK 64-Bit Server VM Zulu24.30+13-CA (build 24.0.1+9, mixed mode, sharing)
The jdk that Android mode is using is another issue and currently I don’t know how to find that out. According to one of your previous posts you are using Windows 7; is that still true?
Code containing Java 17 features does not compile in Android Mode.
I’ll send you examples a little later if you need them.I’ll send you some examples a little later if you need them, but overall it’s not hard to check.
Could you come up with a simple demonstration of this that fails on your system; I’d like to try running it here.
Try using record classes, for example it doesn’t work with them
Try using record classes, for example it doesn’t work with them
Java mode doesn’t recognize the keyword ‘record‘ on my system, so I doubt that Android mode would recognize it either. I’m fairly certain that the Processing IDE uses Java 17 so not sure why it doesn’t work in Java mode.
record Rectangle(double length, double width) { }
Error message:
The class “record” does not exist
Yes i still using Windows 7
To at least somehow reduce the circle of guesses, I can say that the code compiled for version 17 works if it is in the form of a library.
But even in this case, it doesn’t work in Android mode, only in Java mode.
You have written a library? You may need to go to the github repository and post your question there for more direct help: https://github.com/processing/processing-android
You could post your findings and question under the ‘issues‘ tab.
In any case, thank you all for your answers and suggestions, I hope a solution can be found to this issue.
If you compile for Java 16+ that will work.
Processing 4.5.2
Windows 10
Java mode
This is directly from the source for Java mode and may offer an explanation:
record requires Java 16+
:)
It appears that ‘record‘ is not baked into either Java mode or Android mode and probably should be. It looks simpler to use than the standard ‘class’ syntax. Thanks for making us aware of it and keep pursuing it. The runtime can be changed by user input.
Hello @aiapps,
Processing Android mode:
This shows the complexity of getting some things to work:
The article is from 28 June 2023.
I see you have submitted an issue! ![]()
Have fun!
:)

