不要在Linux上的Intellij Idea中添加Intellij Idea中的主类或程序参数

发布于 2025-01-31 03:26:47 字数 1134 浏览 2 评论 0原文

我最近在Linux设备上通过Jetbrains Community Edition安装了Intellij Idea。但是要运行我的第一个程序,我需要添加配置(我对Java没有太多想法,但是过去我使用了Pycharm,并且添加配置面板与在此处添加解释器的东西非常相似)。我不知道任何配置设置,我认为应该自动加载配置设置,这是第一次默认设置,但事实并非如此。如果我必须先创建一个主类,那么我就不会在其中编写什么代码。在每个安装指南中,他们只是假设配置已经存在。在文档等中,他们讲述了如何编辑这些字段以及主类决定在任何程序中要执行的内容。但是我无法添加配置来开始执行任何程序。

中,我需要有关突出显示字段的帮助。

我需要在以下屏幕截图

JetBrains.com的本指南无济于事:

我不确定,但是我首先要创建类似main.java的东西,然后在主类字段中添加它,但我对程序参数完全毫无意义。我猜环境变量是可选的。

请帮忙。谢谢

编辑:这是我要在配置中用于主类字段的文件。

public class Lbasic1 {
    public static void main (String args[]) {
        System.out.println("I make mistakes");
    }
}

编辑2:我在任何地方都没有任何选项,因为run lbasic1.main()在任何地方。这是IDE的屏幕截图

I recently installed IntelliJ IDEA by Jetbrains community edition on my linux device. But to run my first program I need to add configuration (I don't have much idea about Java but I have used PyCharm in the past and add configuration panel is quite similar to add interpreter thing there). I don't know any configuration setting, I think it is supposed to automatically load configuration settings, a default one for the first time, but it doesn't. If I have to create a main class first then I don't what code to write in that. In every installation guide, they just assume that a configuration is already there. In documentations etc. they tell how to edit those fields and the way main class decides what to find in any program to execute. But I couldn't add a configuration to start executing any program.

I need help with the highlighted fields in the following screenshot

enter image description here

This guide from jetbrains.com didn't help:
enter image description here

I'm not sure but I get that first I have to create something like main.java and then add it in the main class field but I'm completely clueless about program arguments. Environment variables are optional I guess.

Please help. Thank You

Edit: Here's the file which I'm trying to use for main class field in the configuration.

public class Lbasic1 {
    public static void main (String args[]) {
        System.out.println("I make mistakes");
    }
}

Edit 2: I don't get any option as Run Lbasic1.main() anywhere. Here is the screenshot of IDE
enter image description here

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文