如何从IntelliJ 14中的临时文件运行代码? [英] How do I run the code from a scratch file in IntelliJ 14?

查看:419
本文介绍了如何从IntelliJ 14中的临时文件运行代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的Java scratch文件,其中包含一个名为 TestGenerics 的类,其中包含一些代码和 main 方法。
代码似乎很好,但是当我尝试运行它时(通过右键单击>运行'TestGenerics.main()'),我收到此错误:Module not specified

I've created a simple Java scratch file containing a class named "TestGenerics" containing some code and a main method. The code seems to be fine, however when I try to run it (by right clicking > Run 'TestGenerics.main()', I get this error: "Module not specified"

包含Lua代码的临时文件出现类似情况,错误消息:'运行scratch.1时出错。(2):可执行文件是未指定'

Similar situation occurs with a scratch file containing Lua code, error message: 'Error running scratch.1 (2): Executable is not specified'

有任何想法吗?

推荐答案

这在以前是不可能的,但现在支持某些语言。例如 Java 和< a href =https://youtrack.jetbrains.com/issue/RUBY-16343\"rel =nofollow> Ruby 。对于这些语言,您应该能够以与以下相同的方式运行暂存文件你运行任何其他文件。

This was previously not possible, but is now supported for some languages. such as Java and Ruby. For these languages, you should be able to run the scratch file in the same way as you run any other file.

这篇关于如何从IntelliJ 14中的临时文件运行代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆