file does not identify a type. You need import java. to import all types in that package or some. Another, more far fetched error, would be that you let your JDK 1. This is a compiler command line. If you are using Eclipse you should specify it in ' Properies' - ' Java build path' - ' Libraries'. share| improve this. mvn install [ ERROR] Failed to execute goal org. plugins: maven- compiler- plugin: 2. 2: compile ( default- compile) on project basespace- sdk: Compilation failure: Compilation failure: [ ERROR]. Compilers from earlier versions of the JDK will baulk at any code that contains these NIO classes. You need to upgrade. as you might not have Java 7 JDK installed correctly and so only java has been, possibly one the JRE. The way import com.
libai688; is not good. You need to import the class you need : import com. Or the whole package stuff : import com. Sounds like you are using a Java version 6 or lower. file package and classes were added as part of Java 7. Try running the following to verify you have Java 7 installed. Java NIO was introduced in Java 7. You need to upgrade to JDK 7 or higher. whenever i compile my code, i get this error : package java. file does not exist im using jdk1. Android does not offer all classes that " conventional java" has to offer.
file is coming with Android O. Have a Look of this Link Android support some classes of NIO packages not full classes.