private DependencyJar getAndroidSdkDependency() { if (!isSupported()) { throw new UnsupportedClassVersionError(getUnsupportedMessage()); } return new DependencyJar("org.robolectric", "android-all", getAndroidVersion() + "-robolectric-" + robolectricVersion, null); }
@Override public void writeTree(TreeNode rootNode) throws IOException, JsonProcessingException { throw new UnsupportedClassVersionError( "Writing JSON nodes not supported"); }
@Override public void writeTree(TreeNode rootNode) throws IOException, JsonProcessingException { throw new UnsupportedClassVersionError( "Writing JSON nodes not supported"); }
public void remove() { throw new UnsupportedClassVersionError(); } };
@Override public void writeTree(JsonNode rootNode) throws IOException { throw new UnsupportedClassVersionError("Writing JSON nodes not supported"); }
@Override public void writeTree(JsonNode rootNode) throws IOException { throw new UnsupportedClassVersionError("Writing JSON nodes not supported"); }
public void remove() { throw new UnsupportedClassVersionError(); } };
@Override public Clock withZone(ZoneId zone) { throw new UnsupportedClassVersionError(); } }
public static void main(String[] args) throws Exception { try { String v = System.getProperty("java.class.version"); if (v!=null) { try { if (Float.parseFloat(v)<52.0f) throw new UnsupportedClassVersionError(v); } catch (NumberFormatException e) { // err on the safe side and keep on going } } ColorFormatter.install(); _main(args); } catch (UnsupportedClassVersionError e) { System.err.println("Jenkins requires Java8 or later, but you are running "+ System.getProperty("java.runtime.version")+" from "+System.getProperty("java.home")); e.printStackTrace(); } }
public static URLClassLoader getURLCLassLoader(ClassLoader loader0) { if (!(loader0 instanceof URLClassLoader)) { ClassLoader loaderParent = loader0.getParent(); if (loaderParent instanceof URLClassLoader) return (URLClassLoader) loaderParent; URLClassLoader newParent = null; try { newParent = new URLClassLoader(new URL[] {}, loaderParent); } catch (Throwable t) { } if (newParent == null) { newParent = URLClassLoader.newInstance(new URL[] {}, loaderParent); addClassloader(newParent); return newParent; } try { setField(loader0, loader0.getClass(), ClassLoader.class, "parent", newParent); } catch (Throwable e) { e.printStackTrace(); throw new UnsupportedClassVersionError("cant find URL Parant"); } return newParent; } else { return (URLClassLoader) loader0; } }
throw new UnsupportedClassVersionError("Split needs to be an instance of FileSplit for this record reader.");
descriptor = BeanDescriptor.createFromImpl((Class)beanClass, beanScope, null, (Class)beanImplClass); } else { throw new UnsupportedClassVersionError("Handle me gracefully / not tested"); throw new UnsupportedClassVersionError("Handle me gracefully / not tested"); throw new UnsupportedClassVersionError("Handle me gracefully / not tested"); throw new UnsupportedClassVersionError("Handle me gracefully / not tested"); throw new UnsupportedClassVersionError("Handle me gracefully / not tested");
return clazz; } catch (UnsupportedClassVersionError ucve) { throw new UnsupportedClassVersionError( sm.getString("ejbClassLoader.unsupportedVersion", name, System.getProperty("java.version")));
/** * Creates a {@link Classfile} by parsing the class file bytes for {@code type} loadable from * {@code context}. * * @throws NoClassDefFoundError if there is an IO error while parsing the class file */ public Classfile(ResolvedJavaType type, DataInputStream stream, ClassfileBytecodeProvider context) throws IOException { this.type = type; // magic int magic = stream.readInt(); assert magic == MAGIC; int minor = stream.readUnsignedShort(); int major = stream.readUnsignedShort(); if (major < MAJOR_VERSION_JAVA_MIN || major > MAJOR_VERSION_JAVA_MAX) { throw new UnsupportedClassVersionError("Unsupported class file version: " + major + "." + minor); } ClassfileConstantPool cp = new ClassfileConstantPool(stream, context); // access_flags, this_class, super_class skipFully(stream, 6); // interfaces skipFully(stream, stream.readUnsignedShort() * 2); // fields skipFields(stream); // methods codeAttributes = readMethods(stream, cp); // attributes skipAttributes(stream); }
return clazz; } catch (UnsupportedClassVersionError ucve) { throw new UnsupportedClassVersionError( sm.getString("ejbClassLoader.unsupportedVersion", name, System.getProperty("java.version")));
return clazz; } catch (UnsupportedClassVersionError ucve) { throw new UnsupportedClassVersionError( sm.getString("ejbClassLoader.unsupportedVersion", name, System.getProperty("java.version")));
/** * Loads the given class in a new class loader. Also tries to instantiate the loaded class (if it * is not an abstract or enum class, or a module-info class), in order to check that it passes the * bytecode verification step. Checks as well that the class can be dumped, to make sure that the * class is well formed. * * @param className the name of the class to load. * @param classContent the content of the class to load. * @return whether the class was loaded successfully. */ public static boolean loadAndInstantiate(final String className, final byte[] classContent) { try { new ClassDump(classContent); } catch (IOException | IllegalArgumentException e) { fail("Class can't be dumped, probably invalid", e); } if (className.endsWith(MODULE_INFO)) { if (getMajorJavaVersion() < 9) { throw new UnsupportedClassVersionError(); } else { return true; } } else { return doLoadAndInstantiate(className, classContent); } }
final Channel channel = channel(); if (channel != null && bytecodeLevel > channel.maximumBytecodeLevel) { throw new UnsupportedClassVersionError("this channel is restricted to JDK 1." + channel.maximumBytecodeLevel + " compatibility but " + name + " was compiled for 1." + bytecodeLevel); return defineClass(name, bytes, 0, bytes.length); } catch (UnsupportedClassVersionError e) { throw (UnsupportedClassVersionError)new UnsupportedClassVersionError("Failed to load "+name).initCause(e); } catch (ClassFormatError e) { throw (ClassFormatError)new ClassFormatError("Failed to load "+name).initCause(e);
return clazz; } catch (UnsupportedClassVersionError ucve) { throw new UnsupportedClassVersionError( sm.getString("ejbClassLoader.unsupportedVersion", name, System.getProperty("java.version")));
throw new UnsupportedClassVersionError(this.getClass().getName() + " does not support backward compatibility with versions older " + "than version 5");