# 运行hello world

1.打开idea

2.file->new->project

![](/files/-M6D90C-1DyLDAir-W-K)

3.选择maven，不创建框架，点击下一步

![](/files/-M6D9FOTLhZNvbKRXdlo)

4.输入工程名，点击完成

5.目录结构

1. demo1 工程名
2. .idea idea的配置文件
3. src 代码资源位置
4. target编译后代码位置
5. demo1.iml 模块配置
6. pom.xml maven相关配置
7. external lib 引用的jar

&#x20;

![](/files/-M6D9iUgPUp76Ztd9zyh)

6.开始编写代码，在src->main->java目录右键，选择new->java class，输入class的名字，注意java名字有命名规范(最好以英文自己大写，驼峰方式命名),我们输入Main,之后在java文件下会出现Main.java文件

![](/files/-M6DBqCcyuHrXvNvaM7l)

7.编写

```
public class Main {
    public static void main(String[] args) {
        System.out.println("hello world");
    }
}

```

最后，在这个文件右键，选择 run Main.main()

![](/files/-M6DBNQMP3nFWQtCDmfj)

8.系统就会编译这个文件输出hello world

![](/files/-M6DBYDSUuBsKzdNJ8q2)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://298073941.gitbook.io/memo/2020-05/java-ji-chu/yun-hang-hello-world.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
