Community
Participate
Working Groups
Build Identifier: 3.6.1 While using JDK 6.0 but with compliance to 1.4, the Eclipse IDE did not alert me that the Arrays.copyOf(...) and Arrays.toString(...) methods were not compatible to JDK 1.4 version. The problem was only verified when deploying on the environment that was using JDK 1.4. Reproducible: Always Steps to Reproduce: 1.Set the project JSDK to 6.0 2.Set the Java Compiler compliance to JDK 1.4 3.Use the java.util.Arrays.toString(byte[]) or java.util.Arrays.copyOf(byte[], length) methods. (without error even it is not JDK 1.4 compliance.
The Arrays methods are part of the JRE, not part of the language. In addition to setting the compiler compliance to 1.4, you also need to specify a 1.4 JRE. Did you do that?
The compiler doesn't detect that as it takes whatever is available on the classpath. So if you really want to be compliant with 1.4, simply set 1.4 libraries on the classpath. Now from within eclipse, you can convert your java project to be a PDE project and then set it to use API Tools. API tools has all what you need to detect these wrong usages. See the following blog entry: http://olivier-eclipse.blogspot.com/2010/11/workspace-settings-vs-project-settings.html
*** This bug has been marked as a duplicate of bug 256034 ***