无法将项目与 Eclipse IDE 中的运行时服务器关联

发布于 2025-01-04 12:54:55 字数 354 浏览 6 评论 0原文

在此处输入图像描述我创建了一个动态 Web 项目。目前它有一个正在尝试运行的 jsp 文件。当我尝试将项目与特定运行时(tomcat 6.0)关联时,它没有发生。

我右键单击项目/属性/目标运行时。它不显示任何运行时(我在服务器中添加了 tomcat 6.0)。当我单击“显示所有运行时”复选框时,所有内容都处于禁用模式。

可能是什么问题?

附上问题的截图。

更新:我什至尝试创建一个新的运行时并将其与项目关联(项目/属性/目标运行时/新)。即使新创建的运行时也被禁用,并且无法将其与项目关联。

enter image description hereI had created a dynamic web project. AS of now it has a jsp file which am trying to run. When I tried to associate the project with a specific runtime(tomcat 6.0), it is not happening.

I right clicked on the project/properties/Targeted Runtimes. It doesn't show any runtimes(I have added tomcat 6.0 in servers). When I click the checkbox 'Show all runtimes', everything comes in disabled mode.

What could be the problem ?

Attached screenshot of the problem.

Update: I even tried to create a new runtime and associate it with the project( project/properties/Targeted Runtimes/new). Even the newly created runtime is getting disabled and am unable to associate it with the project.

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

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

发布评论

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

评论(4

葬﹪忆之殇 2025-01-11 12:54:55

要将项目添加到运行时,您的项目和运行时之间必须匹配;您必须检查:

  • 项目方面:要在 tomcat 上运行,它必须是动态 Web 项目
  • java 版本:例如,您不能在 java 6 运行时
  • Web 项目版本上运行 java 7 项目:您不能运行以下项目:与运行时中可部署的 Java EE 版本不匹配

验证项目和运行时之间的匹配后,您需要项目以运行时为目标,如下所示:

  1. 在 Package Explorer、Project Explorer 或 Navigator 中打开项目。
  2. 右键单击该项目,然后选择“属性”。
  3. 单击属性窗口中的“目标运行时”。
  4. 选择要作为目标的已验证运行时的复选框。
  5. 单击“确定”进行确认。

新的运行时将与该项目关联。如果您要选择的运行时未显示或被禁用,您可能需要卸载一个或多个当前安装的项目构面。这可以在同一属性对话框中完成。

To add a project to a runtime you must have a match between your project and your runtime; you have to check:

  • project facet: to run on tomcat it must be a Dynamic Web Project
  • java version: you can't run for example a java 7 project on a java 6 runtime
  • web project version: you can't run a project that doesn't match the Java EE version deployable in the runtime

Once you've validated the match between your project and the runtime, you need the project to target the runtime, as follows:

  1. Open the project in Package Explorer, Project Explorer, or Navigator.
  2. Right-click on the project, and select "Properties".
  3. Click on "Targeted Runtimes" in the properties window.
  4. Select the checkbox of the validated runtime that is to be targeted.
  5. Confirm by clicking "OK".

The new runtime will be associated with that project. If a runtime that you want to select is not displayed or is disabled, you may need to uninstall one or more of the currently installed project facets. This can be done within the same Properties dialogue.

你的心境我的脸 2025-01-11 12:54:55

这是对我有用的巫毒魔法

  1. 右键单击项目
  2. 单击属性
  3. 转到项目方面
  4. 取消选中动态 Web 模块复选框
  5. 单击右侧选项卡中的运行时。 Apache Tomcat vX.x 现在应该可用
  6. 检查 Apache Tomcat vX.x
  7. 单击“应用”并关闭
  8. 重复前面的步骤 1-3
  9. 检查“运行时”下的“动态 Web 模块”复选框
  10. Apache Tomcat vX.x 应仍处于启用状态
  11. 单击“应用”并关闭

This is the voodoo magic that worked for me

  1. Right-click on project
  2. Click on Properties
  3. Go to Project Facets
  4. Uncheck Dynamic Web Module checkbox
  5. Click on Runtimes in the tabs on the right. Apache Tomcat vX.x should be available now
  6. Check Apache Tomcat vX.x
  7. Click Apply and Close
  8. Repeat the previous steps 1-3
  9. Check Dynamic Web Module checkbox
  10. Apache Tomcat vX.x under Runtimes should still be enabled
  11. Click Apply and Close
离去的眼神 2025-01-11 12:54:55

我知道它已经回答了问题,但如果我能提供帮助,我喜欢与新用户分享我的解决方案。

对我来说,问题是因为 Dynamic wen Project 版本,
3.0 与 java 1.7 一起使用(我使用的是 3.1)。如果它不起作用,您可以访问项目中的 .settings 文件夹,
org.eclipse.wst.common.project.facet.core.xml 文件
并设置您需要的版本。

<installed facet="jst.web" version="3.0"/>

希望我可以帮助新用户

I know it's already answered question, but I like to share my solution with new users if I can help..

For me the problem was because of the Dynamic wen Project version,
3.0 work with java 1.7 ( I was using 3.1) . If it didn't work you can access .settings folder in your project,
org.eclipse.wst.common.project.facet.core.xml file
and set the version that you need.

<installed facet="jst.web" version="3.0"/>

Hope I can help new users

碍人泪离人颜 2025-01-11 12:54:55

我已经找到了解决这个问题的方法。
转到首选项并检查您的目标运行时,如果未显示运行时,您可以通过功能进行配置。选择Dynamic Web 模块为3.0 或3.1

您也可以参考此视频以获取详细说明。 :
https://youtu.be/0W6s0hXbmNE

I have Found a fix for this problem.
Go to Preferences and Check your Targeted runtime, If No Runtime is displayed you can Configure it through Feacts. Select Dinamic Web module to 3.0 or 3.1

You can Also refer to this Video for Detailed Explanation. :
https://youtu.be/0W6s0hXbmNE

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