Cannot import org.eclipse.smarthome

Hey guys,
I just set up a new binding project in eclipse and want to import something from the package “org.eclipse.smarthome” but this import cannot be resolved. I searched for the package and it’s officially moved to an archieve (https://www.eclipse.org/projects/archives.php). Should I use this version and if so, how can I import it into my binding project in eclipse?

What are you trying ti import? Try looking for it in org.openhab.core. Assuming you are developing for OH3, you will not be able to use anything in ESH, since it was migrated into OHC.

I’m trying to import things like this:
import org.eclipse.smarthome.core.events.EventPublisher;
import org.eclipse.smarthome.core.items.GenericItem;
import org.eclipse.smarthome.core.items.GroupItem;
import org.eclipse.smarthome.core.items.Item;
import org.eclipse.smarthome.core.items.ItemNotFoundException;
import org.eclipse.smarthome.core.items.ItemRegistry;
import org.eclipse.smarthome.core.items.StateChangeListener;
import org.eclipse.smarthome.core.items.events.ItemEventFactory;
import org.eclipse.smarthome.core.library.types.DateTimeType;
import org.eclipse.smarthome.core.library.types.DecimalType;
import org.eclipse.smarthome.core.library.types.HSBType;
import org.eclipse.smarthome.core.library.types.OnOffType;
import org.eclipse.smarthome.core.library.types.StringType;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.types.Command;
import org.eclipse.smarthome.core.types.State;
import org.eclipse.smarthome.core.types.TypeParser;

For a little bit of context: I’m updating a binding for the current stable OH Version 2.5

My understanding is that only patch releases will be provided for 2.5 and new add-ons and features would need to be made in OH3.

What you can import depends on what openHAB version the pom.xml files of your project are. If you have version 2.5 you can import eclipse and if it’s 3.0 it will be openHAB. So it looks like you are using the 3.0 base while you want to develop something for 2.5. It’s unclear to me how you ended up in this situation, but it looks like you checked out or installed 3.0 and than copied the 2.5 code into the project. In which case you need to git checkout the 2.5.x branch, either run the skeleton script again if you used it and than copy the code into it again.
As @5iver mentions, if you want a binding included in openHAB repository it needs to be 3.0, but if you want to run it for yourself or distribute it yourself you can just develop on 2.5.

Okay so I followed this guide https://www.openhab.org/docs/developer/ and cloned the repo from https://github.com/openhab/openhab-addons. Is this environment meant for the development of bindings for OH3?