Runtime error. java.lang.NoClassDefFoundError: java/util/functions/Predicate

José Luis Garbi jlgarbi at gmail.com
Wed Oct 10 19:03:32 PDT 2012


Aleksey,

Thanks so much. I knew it was something simple but I couldn't find it.
javac -version and java -version returns the same.
JAVA_HOME is set pointing to C:\Program Files\Java\jdk1.8.0\bin
Still, when using java to run apparently takes other VM.
I used *"C:\Program Files\Java\jdk1.8.0\bin\java" ProjectLambdaMain* and it
works

thanks again and best regards,
José.-

On Wed, Oct 10, 2012 at 3:07 PM, Aleksey Shipilev <
aleksey.shipilev at oracle.com> wrote:

> Are you sure you're running with the same JDK you were building with?
> This seems weird if you had compiled successfully, and then failed in
> the run time with NCDFE.
>
> -Aleksey.
>
> On 10/10/2012 10:02 PM, José Luis Garbi wrote:
> > Hello everyone,
> >
> > I'm new to Project Lambda and I'm giving it a try.
> > I installed 1.8.0-ea-b59 (Win 64 bits)
> > When compiling; I get no errors.
> > When executing; I get an error: Exception in thread "main"
> > java.lang.NoClassDefFoundError: java/util/functions/Predicate
> >
> > Could you please give me some advice? (sorry if it's too basic)
> >
> > *The class definition*
> >
> > import java.util.ArrayList;
> > import java.util.List;
> >
> > public class ProjectLambdaMain {
> >  public static void main(String...  args) {
> >   List<Character> lc = new ArrayList<Character>();
> >   lc.add('a');
> >   lc.add('b');
> >   lc.add('d');
> >   lc.add('1');
> >   lc.add('2');
> >   Iterable<Character> filteredCharList = lc.filter(c ->
> > Character.isAlphabetic(c));
> >   }
> > }
> >
> > *The error*
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > java/util/functions/Predicate
> >         at java.lang.Class.getDeclaredMethods0(Native Method)
> >         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> >         at java.lang.Class.getMethod0(Unknown Source)
> >         at java.lang.Class.getMethod(Unknown Source)
> >         at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
> >         at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
> > Caused by: java.lang.ClassNotFoundException:
> java.util.functions.Predicate
> >         at java.net.URLClassLoader$1.run(Unknown Source)
> >         at java.net.URLClassLoader$1.run(Unknown Source)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at java.net.URLClassLoader.findClass(Unknown Source)
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >         ... 6 more
> >
> >
> > Thanks in advance,
> > José.-
> >
>
>


More information about the lambda-dev mailing list