Search code examples
javajava-8java-5

Use new libraries in java with old JDK


I have in my computer java 8, and I use all the new libraries in java 8, but I'm compiling it on JDk5 because my client has an old version of java and he don't want to change it.

I want to ask - How can I include the libraries that I use from java 8 so my program work in the client's computer?


Solution

  • The libraries of Java 8 themselves depend on new language features built into Java 8. For example, they use lambdas and default methods and static methods on interfaces themselves.

    This means that you cannot just run the libraries of Java 8 in the Java 5 runtime. The libraries built into Java 8 themselves depend critically on the Java 8 runtime.

    You cannot do this.