Questions tagged [java1.4]

Java 2 SE version 1.4 was released in February 2002, and has reached its End of Service Life on October 30th 2008.

Java 2 SE version 1.4 was released in February 2002, and has reached its End of Service Life on October 30th 2008.

This version is no longer supported by Oracle.

See for more information.

121 questions
21
votes
6 answers

Java copy section of array

Is there a method that will copy a section of an array(not arraylist) and make a new array from it? Example: [1,2,3,4,5] and you create a new array from it: [1,2,3] Are there any one line/methods that will do this?
user1102901
  • 565
  • 1
  • 4
  • 12
20
votes
8 answers

How to debug Java OutOfMemory exceptions?

What is the best way to debug java.lang.OutOfMemoryError exceptions? When this happens to our application, our app server (Weblogic) generates a heap dump file. Should we use the heap dump file? Should we generate a Java thread dump? What exactly…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
17
votes
4 answers

How do you set a timeout on BufferedReader and PrintWriter in Java 1.4?

How does one set a timeout on a BufferedReader and a PrintWriter created using a socket connection? Here is the code I have for the server right now, which works until either the server or the client crashes: while(isReceiving){ str = null; …
codewario
  • 19,553
  • 20
  • 90
  • 159
14
votes
4 answers

Alternative to enum in Java 1.4

Since Java 1.4 doesn't have enums I'm am doing something like this: public class SomeClass { public static int SOME_VALUE_1 = 0; public static int SOME_VALUE_2 = 1; public static int SOME_VALUE_3 = 2; public void…
Daniel Moura
  • 7,816
  • 5
  • 35
  • 60
8
votes
5 answers

Backport Java 5/6 features to Java 1.4?

We are stuck with Java2SE v1.4 till the end of 2010. That's really nasty, but we can't help it. What options do we have to use some of the new features already now? I can think of several ways like changing the bytecode, e.g. using Retrotranslator…
Peter Kofler
  • 9,252
  • 8
  • 51
  • 79
7
votes
3 answers

What is the Java 1.4.2 equivalent of Pattern.quote()

What would be a Java 1.4.2 equivalent of Pattern.quote? I was using Pattern.quote() on a URI but now need to make it 1.4.2 compatible.
AHungerArtist
  • 9,332
  • 17
  • 73
  • 109
7
votes
4 answers

String.format equivalent in Java 1.4

Currently i have a method calling String.format() in Java 5 and it's working perfectly String.format("%02x", octet) //octet is a int type However due to some issue we need to deploy this code in a JDK 1.4 environment, and String.format doesn't…
ipohfly
  • 1,959
  • 6
  • 30
  • 57
6
votes
6 answers

HashTable Issue

I have an interesting question which entails the use of Hashtables; I'm developing for S40 Nokia's (with compliance level 1.4) How I expect the Hashtable to work: Hashtable table = new Hashtable(); table.put(1, "Hello World"); However I get the…
dan983
  • 454
  • 2
  • 5
  • 19
5
votes
3 answers

Conditional Number Formatting In Java

How can I format Floats in Java so that the float component is displayed only if it's not zero? For example: 123.45 -> 123.45 99.0 -> 99 23.2 -> 23.2 45.0 -> 45 Edit: I forgot to mention - I'm still on Java 1.4 - sorry!
Joel
4
votes
6 answers

Concise explanations of Java language changes in the major revisions

I'm about to jump into Java development again after a number of years. The language revision I worked with was 1.4.2. I know there have been significant changes to the language since then, and I'm looking for a site or a book that covers these in…
nagul
  • 2,243
  • 2
  • 19
  • 21
4
votes
2 answers

java 1.4 good quality image resize

We have a photo gallery that is using servlets to resize images - we need good performance and decent quality, but we just can't get it right. Also, sadly enough, we have only java 1.4, which leaves us to almost no external image libraries (nearly…
lzk
  • 41
  • 1
4
votes
0 answers

How to disable XML external entity (XXE) processing in JAXP 1.1/Java 1.4?

I'm working on making sure some code isn't vulnerable to XXE attacks. For stuff being compiled and run on Java 7 and Java 8 I've had success with OWASP's recommendations -- see the Java section of…
QuantumMechanic
  • 13,795
  • 4
  • 45
  • 66
4
votes
1 answer

Is it possible to compile Java 1.5 source Web Applications to 1.4?

I tried compiling my webapplication with javac – source 1.5 – target 1.4 I end up with the error: javac: source release 1.5 requires target release 1.5 Since I’m using generics and other features; when I try compiling with –source 1.4 I end up with…
jonasespelita
  • 1,660
  • 5
  • 25
  • 31
4
votes
3 answers

json library for java 1.4

I'm using JCAPS 5.1.3 and only have Java 1.4 and need to handle with Json data. Unfortunately all libraries I've found use Java 1.5 and above. I just found lots of new implementations in this thread here, but which one works with 1.4. Is there a…
rosi
  • 41
  • 1
  • 2
4
votes
2 answers

Check if a BigDecimal is a multiple of another BigDecimal in Java 1.4

I needed to check if a BigDecimal instance is a multiple of another BigDecimal instance. Since I am restricted to Java 1.4, I couldn't make use of BigDecimal.remainder(...). I came up with the following code: /** * Returns true if…
bassim
  • 886
  • 1
  • 21
  • 33
1
2 3
8 9