Question

I have the following very simple java file called test.java

import java.util.concurrent.RecursiveAction;

and when I run

javac test.java

I get the following error

test.java:1: cannot find symbol symbol : class RecursiveAction location: package java.util.concurrent import java.util.concurrent.RecursiveAction; ^ 1 error

and if I run java -version I get

java version "1.7.0_25"

also if I try javap -verbose anotherfile I get that

major=50

so it seems like a must be using java 6.

I'm probably missing something frustratingly silly nevertheless I can;t see what it is.

Was it helpful?

Solution 2

More than likely you are using a JDK earlier than JDK 7 and a JRE that does actually use version 7 which is required for the class. Solution: install JDK 7 which should update the PATH environmental variable - remove the earlier JDK from the PATH

OTHER TIPS

java.util.concurrent.RecursiveAction was only introduced in JDK7 (see the @since annotation in the Javadoc), so if you were to compile your code against an earlier version of the JDK (6 or below) then you would get an error message like this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top