UnsupportedClassVersionError: JVMCFRE003 bad major version in WebSphere AS 7

WebSphere Application Server V7 does support Java Platform, Standard Edition (Java SE) 6 (see Specifications and API documentation in the Network Deployment (All operating systems), Version 7.0 Information Center) and it’s since the release V8.5 when Java 7 has been supported. I couldn’t find the Java 6 SDK documentation, and could only consult IBM JVM … Read more

Which JDK version (Language Level) is required for Android Studio?

Answer Clarification – Android Studio supports JDK8 The following is an answer to the question “What version of Java does Android support?” which is different from “What version of Java can I use to run Android Studio?” which is I believe what was actually being asked. For those looking to answer the 2nd question, you … Read more

Simple Java HTTPS server

What I eventually used was this: try { // Set up the socket address InetSocketAddress address = new InetSocketAddress(InetAddress.getLocalHost(), config.getHttpsPort()); // Initialise the HTTPS server HttpsServer httpsServer = HttpsServer.create(address, 0); SSLContext sslContext = SSLContext.getInstance(“TLS”); // Initialise the keystore char[] password = “simulator”.toCharArray(); KeyStore ks = KeyStore.getInstance(“JKS”); FileInputStream fis = new FileInputStream(“lig.keystore”); ks.load(fis, password); // Set … Read more

java.lang.UnsupportedClassVersionError Unsupported major.minor version 51.0 [duplicate]

These guys gave you the reason why is failing but not how to solve it. This problem may appear even if you have a jdk which matches JVM which you are trying it into. Project -> Properties -> Java Compiler Enable project specific settings. Then select Compiler Compliance Level to 1.6 or 1.5, build and … Read more

Generic support for ISO 8601 format in Java 6

Seems that you can use this: import java.util.Calendar; import javax.xml.bind.DatatypeConverter; public class TestISO8601 { public static void main(String[] args) { parse(“2012-10-01T19:30:00+02:00”); // UTC+2 parse(“2012-10-01T19:30:00Z”); // UTC parse(“2012-10-01T19:30:00”); // Local } public static Date parse(final String str) { Calendar c = DatatypeConverter.parseDateTime(str); System.out.println(str + “\t” + (c.getTime().getTime()/1000)); return c.getTime(); } }

How to use TLS 1.2 in Java 6

After a few hours of playing with the Oracle JDK 1.6, I was able to make it work without any code change. The magic is done by Bouncy Castle to handle SSL and allow JDK 1.6 to run with TLSv1.2 by default. In theory, it could also be applied to older Java versions with eventual … Read more

Getting the name of a method parameter

Parameter names are available if you have told the compiler to include them (compile with debug information). Spring has ParameterNameDiscoverer which can help you obtain the names. The default implementation uses asm ClassReader to do so. With javac you should include the -g argument to include debug information. With Eclipse I think it is there … Read more

Using File.listFiles with FileNameExtensionFilter

The FileNameExtensionFilter class is intended for Swing to be used in a JFileChooser. Try using a FilenameFilter instead. For example: File dir = new File(“/users/blah/dirname”); File[] files = dir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(“.txt”); } });

tech