In a programe,
import java.nio.file.*;
Gives error - The import java.nio.file cannot be resolved
Following other threads, I changed JDK Compliance Level to 1.7, also added
-vm
/home/user/jdk1.7.0_79/bin/java
to eclipse.ini
Eclipse -> About -> Installation details has following lines -
java.home=/home/user/jdk1.7.0_79/jre
java.library.path=/home/user/jdk1.7.0_79/jre/lib/i386/server:/home/user/jdk1.7.0_79/jre/lib/i386:/home/user/jdk1.7.0_79/jre/../lib/i386:/usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
java, javac versions -
user$ ~/jdk1.7.0_79/jre/bin/java -version java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) Server VM (build 24.79-b02, mixed mode) user$ ~/jdk1.7.0_79/bin/java -version java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) Server VM (build 24.79-b02, mixed mode) user$ ~/jdk1.7.0_79/bin/javac -version javac 1.7.0_79
How should I correctly import java.nio.file.*
?
import java.nio.file.*;
?java.nio.file
is a package, not a class and can therefore not be imported. – Turing85-Djava.home=/path/to/jdk
to ini and restart eclipse it still shows the jre path – user13107