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
9
votes
3 answers

Affect the order of NetworkInterface.getNetworkInterfaces enumeration in Java 6 on Linux

What is the order in which NetworkInterface.getNetworkInterfaces() returns an enumeration of network interfaces? Is there a way to affect that on JVM level or on Linux OS level?
Andrey Adamovich
  • 20,285
  • 14
  • 94
  • 132
9
votes
7 answers

@override annotation in JDK 1.6

I'm using JDK1.6. When I implement an interface and in the implementing class, if I give @override before my function names, Eclipse throws an compilation error. i.e. below code is wrong according to Eclipse. public class SomeListener implements…
Veera
  • 32,532
  • 36
  • 98
  • 137
9
votes
4 answers

Do i have to install jdk win64?

I have installed windows 7 x64, therefore i have a confusion whether i have to install JDK x64 or JDK x86? please help me, thank you
srisar
  • 1,495
  • 5
  • 18
  • 27
9
votes
1 answer

Running JUnit4 Test classes in specified order

I've written a number of tests, divided not only into separate classes but, depending on what area of my application they're testing, into separate sub-packages. So, my package structure looks a bit like…
blalasaadri
  • 5,990
  • 5
  • 38
  • 58
9
votes
3 answers

How do I Pipe process output to a file on Windows and JDK 6u45

I have the following windows batch file (run.bat): @echo off echo hello batch file to sysout And the following java code, which runs the batch files and redirects output to a file: public static void main(String[] args) throws IOException { …
Barak
  • 3,066
  • 2
  • 20
  • 33
9
votes
3 answers

Servlet.service() throws ClassCastException

I have a java web application. I have set up this new project and getting the following exception when I run a jsp, Oct 10, 2012 3:01:49 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw…
Rishabh
  • 338
  • 1
  • 3
  • 17
8
votes
3 answers

Experience with JDK 1.6.x G1 ("Garbage First")

I'd like to know what are the experiences with G1 garbage collector in newest JDK? I see NullPointerException thrown in my program, although code didn't change and behave correctly in earlier JDKs.
Roman Kagan
  • 10,440
  • 26
  • 86
  • 126
8
votes
3 answers

Can I ignore BeanCreationException and inject null instead?

We have a situation where our Spring wires up some beans that include ActiveMQ classes built with Java 6. Our application runs on customer's servers, so we can't guarantee that they have Java 6 or later installed. If they happen to have Java 5,…
Sean Adkinson
  • 8,425
  • 3
  • 45
  • 64
8
votes
3 answers

Eclipse chokes on enum, even though Compiler compliance level is 1.6

I have set my Eclipse project's Compiler compliance level to 1.6 But I get errors like in the screenshot below: Syntax error, annotations are only available if source level is 1.5. I have refreshed/cleaned/restarted Eclipse at least 10 times. It…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
8
votes
4 answers

Why is HashMap containsKey slower than get in Sun JDK? (sun-jdk-1.6.0.17)

Why is calling containsKey on a HashMap slower then get? Test: http://ideone.com/QsWXF (>15% difference, run on sun-jdk-1.6.0.17)
Stefan
  • 838
  • 3
  • 13
  • 28
8
votes
1 answer

What does Java compile an enumeration down to?

A coworker and I had a discussion about how Java represents enumerations. I was under the impression they were strictly ints like C/C++. Or, if you add behavior (Type-Safe enum), it gets wrapped in a class. He believed that if it's small enough Java…
Tony
  • 2,473
  • 1
  • 21
  • 34
8
votes
6 answers

Eclipse crashes at startup; Exit code=13

I am trying to work with Eclipse Helios on my x64 machine (Im pretty sure now that this problem could occur with any eclipse) but it just doesn't cooperate. When I try to run eclipse I get the following: I have installed Helios EE x64 (latest…
Xitcod13
  • 5,949
  • 9
  • 40
  • 81
8
votes
1 answer

Jenkins Sonar plugin suddenly stops working

Our Jenkins builds started failing overnight with the error: [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli) on project : Execution default-cli of goal…
Rasmus Faber
  • 48,631
  • 24
  • 141
  • 189
8
votes
3 answers

How to generate end tag for empty element in XML using JAXB

I'm generating XML using JAXB. But JAXB is generating an empty Tag closing it self. But my client want separate empty tag. I know both are equals but he is not agree with me. please any one suggest the solution. Thanks. Sample…
Rajesh Narravula
  • 1,433
  • 3
  • 26
  • 54
8
votes
3 answers

Java: easiest way to package both Java 1.5 and 1.6 code

I want to package a piece of code that absolutely must run on Java 1.5. There's one part of the code where the program can be "enhanced" if the VM is an 1.6 VM. Basically it's this method: private long[] findDeadlockedThreads() { // JDK 1.5…
SyntaxT3rr0r
  • 27,745
  • 21
  • 87
  • 120