---
title: "Eclipse如何在main方法中注入参数"
author: "书安然"
date: "2015-01-31T18:27:55Z"
tags: []
categories: ["Web前端"]
slug: "eclipse-main"
draft: false
lastmod: "2015-01-31T18:27:55Z"
id: 2182034
url: "https://amflytogether.iteye.com/blog/2182034"
---

如何在主函数中注入参数值

```java

//在主函数中注入两个值 ："str1","str2"
public static void main(String[] args){
}


```

在当前类右击选择Run Configurations 里有一个
|Main|(x)=Arguments ｜JRE
在Arguments里输入参数值