简体   繁体   中英

missing java.lang and other basic libraries in my IDE

Cannot resolve method on getString.

I'm fairly sure my path is just screwed up or something, this is a fresh jdk 1.8 install I did yesterday and reinstalled tonight, using intelliJ and Eclipse I don't have access to basic methods like getString and length, and if I manually add the libraries to my java file, they aren't found.

SOME libs are still available and can be found (though I had to point them out to my IDE to fix them automatically), like

import java.net.URL;
import java.net.URLEncoder;
import java.util.Scanner;

I would just install missing libraries manually but things as basic as java.lang I can't find downloads for. What is wrong with my Java installation? I just installed from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Can I check my folder for missing things?

I've set the following environment variables:

CLASSPATH C:\Program Files\Java\jdk1.8.0_101\bin;C:\Program Files\Java\jdk1.8.0_101\jre\bin;.

PATH C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\GtkSharp\2.12\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Python\Python35\Scripts;C:\Program Files\nodejs\

JAVA_HOME C:\Program Files\Java\jdk1.8.0_101

Not sure if this is a solution for your issue. But I could find these flaws in you SO question. You have not included JAVA_HOME C:\\Program Files\\Java\\jdk1.8.0_101 in the path variable. Class Path specifies the location for JVM to find the .class files that get generated by your program. you can include as many path just by specifying ;

I would start with Intellij settings, cause it looks like bad project configuration. shift+ctrl+alt+s or File > Project Structure from there Project Settings > Project > Project SDK set correct JDK

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM