How to build updates for OH 3.4

SNAPSHOT 4.0.0 is based on Java 17

How to build a binding update for OH 3.4

I tried “mvn -Dohc.version=3.4.0 clean install”, which builds a jar, but it can’t be loaded, because it’s compiled for Java 17, whereas 3.4 uses Java 11.

Checkout the 3.4.x branch

you mean git clone?

But this doesn’t setup the IDE, correct? 3.4 requires a Java 11 environment not just the code

If you’ve already cloned something in the past, you simply just need to check out a different branch, in this case the 3.4.x branch.

As for the “Java11 environment”, you’d have to set that up yourself, that’s a totally separate thing, but that should be pretty easy too.

Usually I use the Eclipse Installer, but the current one only offers the main branch and Java 17. Is there any way to switch to OH 3.4 environment with the Installer?

I use vscode and set up the java environment using shell environment variable and use cli to do the compiling / building.

Ok, I got it working with git clone + java_home -v 11; thx

1 Like