简体   繁体   English

“运行方式”在Eclipse Juno中不起作用

[英]“Run as” not working in Eclipse Juno

I am using Eclipse Juno, trying to use TestNG and Selenium to do some testing. 我正在使用Eclipse Juno,尝试使用TestNG和Selenium进行一些测试。 When I write my java file to run the test, as per instruction, I should be able to right click and then see "run as" with an arrow and some options, including TestNG - but I get no options, and cannot see TestNG. 当我按照说明编写Java文件运行测试时,我应该能够右键单击,然后看到带有箭头和一些选项(包括TestNG)的“运行方式”,但我没有任何选择,也看不到TestNG。 I also get the following error but am not clear if its related: 我也收到以下错误,但不清楚是否与之相关:

An internal error occurred during: "Compute launch button tooltip". 在以下过程中发生内部错误:“计算启动按钮工具提示”。 Bad version number in .class file .class文件中的版本号错误

Can anyone help? 有人可以帮忙吗?

Ps someone will probably say "you have the wrong version of the jdk or a mismatched version" which may be true but can you tell me how/where to check / change this? ps有人可能会说“您的jdk版本错误或版本不匹配”,这可能是正确的,但是您能告诉我如何/在何处检查/更改吗?

Navigate to your Java project, right-click, navigate to Build Path > Configure Build Path.. , and then select the "Libaries" tab. 导航到Java项目,右键单击,导航到“ 构建路径” >“ 配置构建路径..” ,然后选择“库”选项卡。 It's there that you can set the Java library used by your project. 您可以在其中设置项目使用的Java库。 And then you'll probably want to clean your project and rebuild. 然后您可能需要清理项目并重建。

Right click java project and select Build path ->Configure build path. 右键单击Java项目,然后选择Build path-> Configure build path。 There check the jdk version and java compiler version. 在那里检查jdk版本和java编译器版本。 Change compiler version to jdk version. 将编译器版本更改为jdk版本。 Clean and build the project. 清理并构建项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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