Hello, i'am having a problem, i download the last jdk and now when i try to import classes like scanner i get an error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hello, i'am having a problem, i download the last jdk and now when i try to import classes like scanner i get an error

Problem using intellij and netbeans

23rd Jul 2017, 8:14 PM
AG K Baixada
AG K Baixada - avatar
8 Answers
+ 1
Open command prompt and type: java -version javac -version if you got warning, then check the global environment variable 'path' in advanced system settings. It should contains the full path to the newest JDK. if you get the newest versions, then the installation is fine. The problems maybe in the IDE. IntelliJ: Get in file -> settings -> java compiler. It should be 1.8. Go in file -> project structure -> properties -> project SDK. It should be 1.8 too.
23rd Jul 2017, 9:08 PM
Boris Batinkov
Boris Batinkov - avatar
0
Did you insert the environment variable path in the pc . If you dont the go to c drive find java folder click on jdk the go to bin and copy the address ,the go to properties of the pc and click on advance system settings and click on "environment variable" and add new path name anything and paste the copied address. make sure that if you are compling the program the class name and the saved program file name should be same
23rd Jul 2017, 8:25 PM
Shrikant Narvekar
Shrikant Narvekar - avatar
0
yes i did that i created in path, i'm reinstalling
23rd Jul 2017, 8:26 PM
AG K Baixada
AG K Baixada - avatar
0
how did you import it . use "import java.util.*;" or "import java.util.Scanner;"
23rd Jul 2017, 8:28 PM
Shrikant Narvekar
Shrikant Narvekar - avatar
0
import java.util.Scanner; public class Aula { public static void main(String[] args) { Scanner input = new Scanner(System.in); } } and i don't know the programs i use show me un error i can't program
23rd Jul 2017, 8:34 PM
AG K Baixada
AG K Baixada - avatar
0
If you are using PC the save then file as Aula.java and in the cmd use javac Aula.java to compile it and use java Aula to run it .
23rd Jul 2017, 8:37 PM
Shrikant Narvekar
Shrikant Narvekar - avatar
0
thanks nice help, it works
23rd Jul 2017, 8:46 PM
AG K Baixada
AG K Baixada - avatar
0
you right i change it now, in project Structure that was the problem thank you so much now i can program
23rd Jul 2017, 9:12 PM
AG K Baixada
AG K Baixada - avatar