Complete Test attached for reference. There are 3 cases with different algorithm names. Please try for each case as the exception message differs.
KeyFactory kf = KeyFactory.getInstance(algorithm, provider);
PKCS8EncodedKeySpec privSpec = new PKCS8EncodedKeySpec(
Base64.getMimeDecoder().decode(<Openssl generated keys string>));
EdECPrivateKey privKey
= (EdECPrivateKey) kf.generatePrivate(privSpec);
checkPrivKeyFormat(privKey.getEncoded());
NamedParameterSpec namedSpec = new NamedParameterSpec(<algorithm name as applicable>);
EdECPrivateKeySpec edprivSpec
= new EdECPrivateKeySpec(namedSpec, privKey.getEncoded());
privKey = (EdECPrivateKey) kf.generatePrivate(edprivSpec); // FAILS here while generating the keys.