0

I use the lib commons-lang-2.4.jar for my project. I develop under Windows, then send everything (including those libs) to Ubuntu server 4.6.3 Under windows, everything works fine. But when I launch my program under Ubuntu, I get this error:

java.lang.NoSuchMethodError: java.lang.String.join(Ljava/lang/CharSequence;[Ljava/lang/CharSequence;)Ljava/lang/String;

How can I fix it?

devios1
  • 36,899
  • 45
  • 162
  • 260
Hermios
  • 622
  • 1
  • 5
  • 20

1 Answers1

3

String.join was only introduced in Java 8 (JDK 1.8). Your windows machine apparently has it, while your ubuntu machine has an older version of the JDK installed. This has nothing to do with their respective operating systems or commons-lang-2.4.jar.

TL;DR - upgrade to JDK 1.8 on your ubuntu machine.

Mureinik
  • 297,002
  • 52
  • 306
  • 350