First of all, it is strongly advised to use Java Runtime Environment 6 or later. However, there is a case where Eclipse does not work with JRE6. In this case you can fallback to running Eclipse in JRE5.
But to make Compose*/Java work properly you need to take some additional steps. JDK6 is only optional when Eclipse is running in JRE6. This is because in that case Compose*/Java can use the Eclipse JDT Java compiler. This compiler is not available when Eclipse is run in JRE5.