字符串无法解析为类型 - Java RAD

发布于 2024-12-08 07:06:31 字数 245 浏览 3 评论 0原文

我最近开始使用 Java 进行开发(来自 .Net)。我使用的IDE是RAD 7.3。

导入需要对其进行一些增强的项目后,我收到此错误:

“字符串无法解析为类型”

这适用于字符串数据类型的所有变量,以及任何采用字符串争论的方法。我对 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 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

瘫痪情歌 2024-12-15 07:06:31

我的猜测是您错过了项目中的 JRE 运行时库。但这会导致所有 java.* 类生成此消息!您可以发布您的代码以便我们看看可能是什么问题吗?

尝试这样做:

右键单击您的项目。
-> 属性
->java 构建路径
->选项卡 Libraries

检查 JRE 系统库是否存在。

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.

旧竹 2024-12-15 07:06:31

我是初学者。我正在使用 Eclipse,但卡在了 Hello World 代码中。收到相同的错误描述,并且还显示错误无法解析“系统”

沮丧了几个小时后,当我检查 JRE 库路径和其他内容时,我只是将“字符串”和“系统”的“S”大写......然后砰......问题解决了。我希望这有帮助。

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.

过度放纵 2024-12-15 07:06:31

我不知道这是否对任何人有帮助,但我来了。
我刚才在 Visual Studio Code 中遇到了同样的问题(我在 Linux 上)。在我的 java.home 上,我的目录中有以下选项:

  • /usr/lib/jvm/java-8-openjdk-amd64
  • /usr/lib/jvm/java-1.8.0-openjkd-amd64

我默认使用第一个,但是当我切换到第二个时,一切都开始了工作正常。

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.

错々过的事 2024-12-15 07:06:31

您需要将字符串中的“s”大写。

You need to capitalize the "s" in the string.

停滞 2024-12-15 07:06:31

解决这个问题的另一种方法是通过以下方式。

右键单击项目-->属性-->Java构建路径-->转到
库选项

并删除或删除有错误的库,之后选择添加库并下载已删除并准备好的库。

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.

烟火散人牵绊 2024-12-15 07:06:31
error- string cannot be resolved to a type

这里在声明方法时,粗体的“string”是小写的。
将字符串更改为大写。
例子:
公共静态字符串 howManyPass(双grd1,双grd2){
}

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) {
}

萧瑟寒风 2024-12-15 07:06:31

对于 Spring Boot 用户,请检查您的 pom.xml 文件,了解您最新添加的依赖项是什么。对我来说,一旦删除了一些依赖项,问题就消失了。

For Spring Boot users, please check your pom.xml file as what are the dependencies you've added in latest. For me the problem was gone once I removed some dependencies.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文