Questions tagged [java-5]

Java SE version 5 was released in September 2004 and is no longer supported by Sun as of November 2009. Use only if your question is specifically related to features of this version.

Java version 5 (or 1.5).

Use only 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.

350 questions
19
votes
3 answers

Did we always have to register to download the Java 5 JDK, or is this new Oracle fun?

I could swear that just a couple of months ago I downloaded a copy of the Java 1.5 SE JDK and I did not have to give them information on my first born. Today, I had to go through the register-and-we-will-send-you-a-link-someday dance. I have not…
Ukko
  • 2,236
  • 2
  • 21
  • 33
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
16
votes
9 answers

SEVERE: A message body writer for Java class java.util.ArrayList and MIME media type application/json was not found

I am testing RESTful services and when I execute I am getting exceptions although I have the following jars in my class path(WEB-INF/lib), I am not using Maven and my JDK version is 1.5. Other questions regarding this issue didn't help to resolve…
Jacob
  • 14,463
  • 65
  • 207
  • 320
15
votes
2 answers

Invalid maximum heap size

I have copied a jdk directory from another location. Since then, I get the following error message. Your environment has been set. java version "1.5.0_22" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03) Java HotSpot(TM) Client…
AlwaysALearner
  • 6,320
  • 15
  • 44
  • 59
15
votes
9 answers

Do you use Java annotations?

Possible Duplicates: How and where are Annotations used in Java? Java beans, annotations: What do they do? How do they help me? Over and over, I read about Java 5's annotations being an 'advanced feature' of the language. Until recently, I…
Matt Luongo
  • 14,371
  • 6
  • 53
  • 64
14
votes
5 answers

When should I use the java 5 method cast of Class?

Looking through some code I came across the following code trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto)); and I'd like to know if casting this way has any advantages over…
Steve Bosman
  • 2,599
  • 1
  • 25
  • 41
14
votes
7 answers

Java method works in 1.5 but not 1.6

I have an application which has been running happily under Java 1.5 for around a year. We've just had the boxes updated and had Java 1.6 installed. After deploying the app to the new server we've found the application is throwing an exception when…
James Camfield
  • 1,636
  • 3
  • 16
  • 24
13
votes
4 answers

Will compiling for Java 1.5 on Java 1.7 still work?

I've recently moved to Java 7 in one of my projects. I claim that it can run on Java 1.5 simply because there's nothing I depend on that is in Java 6 or 7. However when compiling today I noticed this: bootstrap class path not set in conjunction with…
TheLQ
  • 14,830
  • 14
  • 69
  • 107
12
votes
5 answers

Maven - Use JDK 7 to Compile for JVM 5

I've been trying to get this to work for a while now but no luck yet. I want to run with JAVA_HOME pointing to JDK7 but I want to compile a project for JVM 5. I've read through documentation, I've found similar posts on SO, but none of them seem to…
Alex Ciminian
  • 11,398
  • 15
  • 60
  • 94
12
votes
2 answers

Cant understand the working of File object.delete()

I am trying to delete a jar file using java 5 (So the Paths API introduced in Java 7 is not an option). My code: String sep = File.separator; File test = new File("."+ sep + "server" + sep + "lib" + sep + "testJar.jar"); if(test.delete()) { …
amudhan3093
  • 740
  • 9
  • 17
11
votes
4 answers

Java Quickly check for network connection

My issue is fairly straightforward. My program requires immediate notification if a network connection is lost. I'm using Java 5, so I'm unable to use the very handy features of NetworkInterface. Currently I have two different methods of checking…
BenCole
  • 2,092
  • 3
  • 17
  • 26
11
votes
2 answers

Illegal access exception when trying to access attibrute from parent class by introspection

I am currently playing with introspection and annotations in Java 1.5. The have a parent abstract class AbstractClass. The inherited classes can have attributes (of type ChildClass) annotated with a custom @ChildAttribute annotation. I wanted to…
Raphael Jolivet
  • 3,940
  • 5
  • 36
  • 56
11
votes
8 answers

Cross-platform way to open a file using Java 1.5

I'm using Java 1.5 and I'd like to launch the associated application to open the file. I know that Java 1.6 introduced the Desktop API, but I need a solution for Java 1.5. So far I found a way to do it in Windows: Runtime.getRuntime().exec(new…
asalamon74
  • 6,120
  • 9
  • 46
  • 60
11
votes
4 answers

Why the output is different between JDK 1.4 and 1.5?

I'm running this code with JDK 1.4 and 1.5 and get different results. Why is it the case? String str = ""; int test = 3; str = String.valueOf(test); System.out.println("str[" + str + "]\nequals result[" + (str == "3") + "]"); if (str == "3") { …
omgeeeee
  • 131
  • 6
11
votes
3 answers

When should we use console class?

I was reading about Console class, and in the very first line, it was written New to Java 6 and when we are running Java SE 6 from command line, then we are typically using console class object So, which means we are implicitly using console…
Ravi
  • 30,829
  • 42
  • 119
  • 173
1
2
3
23 24