ICC and ICJ have different roles. The ICJ's subjects are countries whereas the ICC deals with individuals.
In this case, the ICC has jurisdiction because the alleged crimes were committed in the territory of a signatory (Palestine) and because Palestine indeed found itself unable to prosecute them.
[flagged]