Questions tagged [java-6]

Java SE version 6 was released in December 2006. Use this tag for questions specific to this version of Java.

Java SE 6 was an evolutionary change over the previous version. It did not include extensive language or JVM changes, however such changes were planned for Java SE 7 which was supposed to be released much sooner. (See here for what changed in Java 6).

As a stop-gap to the much delayed Java 7, Sun (since purchased by Oracle) introduced Java SE 6 Update 10, which despite its modest version numbering, represented extensive improvements to the GUI capabilities of Java in order to support JavaFX and Sun's renewed attempt to make Java successful in the GUI arena.

Internally, Java is numbered with a "1." before the number, so it will report itself as "1.6.0_" with an update number at the end. Starting with version 6, Sun dropped the ".0" from its marketed version number, so instead of 5.0 as previously done, it was Java 6.

Only use this tag if your question is specifically related to features of this version. Just because you are using this version, doesn't mean you need this tag. Use in addition to or instead of this tag.

See for more information.

1391 questions
26
votes
6 answers

Mac OS X Java Update: where is my jdk?

I've installed on my iMac (Mac OS X 10.6.6) the Java update which contains the version 1.6.0_24 of the jdk. I think this update has changed the directory structure of the jdk, so now I'm not able to configure it on eclipse. Before the update my…
javanna
  • 59,145
  • 14
  • 144
  • 125
24
votes
3 answers

New features in JDK 1.6 and 1.7

I know JDK 1.5 pretty well. As we all know, besides new API (such as AtomicInteger, for example), there were major language changes such as providing support for generic, adding enum, prividing auto-boxing and auto-unboxing and so on. I want to find…
alexsmail
  • 5,661
  • 7
  • 37
  • 57
23
votes
1 answer

Why is this method overloading ambiguous?

public class Primitive { void m(Number b, Number ... a) {} // widening, autoboxing->widening->varargs void m(byte b, Number ... a) {} // unboxing, autoboxing->widening->varargs public static void main(String[] args) { Byte b =…
Aman
  • 979
  • 3
  • 10
  • 23
23
votes
4 answers

Varargs in method overloading in Java

The following code doesn't compile. package varargspkg; public class Main { public static void test(int... i) { for (int t = 0; t < i.length; t++) { System.out.println(i[t]); } System.out.println("int"); …
Tiny
  • 27,221
  • 105
  • 339
  • 599
23
votes
4 answers

Is it possible to compile class files with the Java 7 SDK which can run on Java 6 JVMs?

Since the public Java 6 SE JRE is getting closer to it's EOL (Nov '12), I'm considering porting my projects from Java 6 to Java 7. This would'nt be a big deal, if Apple would provide a Java 7 JRE for Mac OS X. But since Apple isn't willing to do so,…
t3chris
  • 1,390
  • 1
  • 15
  • 25
20
votes
6 answers

Compiling with JDK 1.8 java: cannot access class file... class file not found

Though the same code was getting to compiled successfully with JDK 1.6 version, after upgrading to JDK 1.8 it won't compile, saying java cannot access ....class file ...as class file not found though it exists. I am compiling this in IntelliJ Idea…
Anil Kamaraju
  • 481
  • 1
  • 4
  • 12
19
votes
1 answer

Switch java version on CentOS 6

I have a CentOS 6 virtual box with Java 1.7 present. $ java -version java version "1.7.0_51" OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02) OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode) $ javac -version javac 1.7.0_51 I…
Olivier Grégoire
  • 33,839
  • 23
  • 96
  • 137
18
votes
3 answers

TimeZone.setDefault changes in JDK6

I just noticed that JDK 6 has a different approach to setting a default TimeZone than JDK5. Previously the new default would be stored in a thread-local variable. With JDK6 (I just reviewed 1.6.0.18) the implementation has changed, so that if the…
Tom
  • 1,965
  • 3
  • 25
  • 33
18
votes
1 answer

When is Java 6 end of life? (In the context of writing developer tools)

Background This is not as immediately obvious to figure out as you would think. First off, while Oracle has stopped public support of Java 6 as of Feb 2013 but with Premier support going out to Dec 2013 and Extended support going to Dec 2016 there…
Stephen Connolly
  • 13,872
  • 6
  • 41
  • 63
17
votes
2 answers

JDK 1.7 vs JDK 1.6 inner classes inheritance difference

I'm on solving some Java puzzles and stumbled on this one: public class Outer { class Inner1 extends Outer {} class Inner2 extends Inner1 {} } While compiling this code with javac 1.6.0_45 I'm getting, as expected, this error: Outer.java:8:…
ar4ers
  • 740
  • 5
  • 19
17
votes
3 answers

Why do two methods with signature (primitive, wrapper) and (primitive, primitive) cause the method call (wrapper, primitive) to be ambiguous?

It's just an exercise but I can't figure out the ambiguity: private static void flipFlop(String str, int i, Integer iRef) { System.out.println(str + "ciao"); } private static void flipFlop(String str, int i, int j) { System.out.println(str +…
dierre
  • 7,140
  • 12
  • 75
  • 120
17
votes
8 answers

How to silently install Java JDK into a specific directory on windows

On my development machine I always have to install Java 6 and Java 7 and I have to install each JDK in both, the 32 and 64 bit version, for testing purposes. Since the frequency of Java updates seems to be getting more and more ridiculous (twice per…
mmo
  • 3,897
  • 11
  • 42
  • 63
17
votes
5 answers

Java nested generic type mismatch

In the following example: public static void main(String[] args) { List b = new ArrayList(); first(b); second(b); List> a = new ArrayList>(); third(a); fourth(a); // doesnt…
why
  • 1,275
  • 4
  • 12
  • 23
17
votes
2 answers

Generic class compiles in Java 6, but not Java 7

I have an interface in Java 6 that compiles correctly: public interface IMultiMap extends Map> { public int valueSize(); public boolean put(K key, V value); public void clear(Object key); public boolean…
Brian
  • 17,079
  • 6
  • 43
  • 66
16
votes
2 answers

What is the difference between the Java 1.6 and 1.7 jarsigner

Just noted that you can´t sign Android APKs with the Java 1.7 jarsigner. So I wonder why this is and what is the difference between the 1.6 and 1.7 signer?
Martin
  • 11,577
  • 16
  • 80
  • 110
1 2
3
92 93