String cannot be resolved to a type - Java RAD
I've recently started developing in Java (coming from .Net). The IDE I am using is RAD 7.3.
After importing a project, which I need to do some enhancements on, I am receiving this error:
"String cannot be resolved to a type"
This applies to all variables of the String data type, as well as any methods that take string arguements. I'm very inexperienced with Java so I'm开发者_如何学JAVA not sure how to go about fixing this. My guess is that it has something to do with the way RAD was installed, and that required libraries are missing. Again, not sure how to address that.
Any help or guidance would be much appreciated! Thank you
My guess is you miss the JRE Runtime Library in your project. But this would cause all the java.* classes to generate this message! Can you post your code so we can see what might be the problem?
try doing :
right-click on your project. ->properites ->java Build Path ->tab Librairies
check if the JRE System Library is there.
i am a beginner. i am using Eclipse and got stuck at the Hello World code. Got same error description and also error stating can't resolve 'system'.
After staying frustrated for few hours, as I checked JRE library path and stuff, I just Capitalized 'S' of 'string' and 'system'.. and bang.. problem solved. I hope this helps.
I don't know if this helps anyone, but here I go. I had the same problem just now in Visual Studio Code (I am on Linux). On my java.home, I had the options in my directory of:
- /usr/lib/jvm/java-8-openjdk-amd64
- /usr/lib/jvm/java-1.8.0-openjkd-amd64
I had the first one as default, but when I switched to the second one, it all started working properly.
You need to capitalize the "s" in the string.
Another way to solve this problem is in the following way.
Right click on the project-->properties-->Java build path-->go to the library option
and delete or remove the library that is in error, after this you select add library and download the library that you deleted and ready.
error- string cannot be resolved to a type
Here in the declaring the method "string" in bold is lower case. Change string to upper case. Example: public static string howManyPass(double grd1, double grd2) { }
精彩评论