---
title: "eclipse RCP 开发中的程序参数使用"
author: "chenqisdfx"
date: "2018-09-10T19:32:50Z"
tags: []
categories: ["开源软件"]
slug: "eclipse-rcp"
draft: false
lastmod: "2018-09-10T19:32:50Z"
id: 2430386
url: "https://sdfx.iteye.com/blog/2430386"
---

在使用eclipse进行rcp开发时等，如果需要配置自定义程序参数，可以在eclipse运行配置窗口的arguments中写入。

![](http://10.41.135.201/Mapi/inlinepic/services.jssm?CT=0&PT=0&ID=00c90000abf50fb73a69acd100002&N=51011956-50901-16911-140196-214-170-89216-137-236.png&U=10131251&S=0&I=1&T=2&D=00c90000abf50fb73a69acd100002&UNO=10131251&Token=00012afd0000abf55b7e3596Pp7Q%23MjWmOCalvdOGsrcAIX94&X-ZMAIL-RESID=1&X-ZMAIL-ISTEST=0)

 

在使用时，win系统

Object x = properties.get("eclipse.commands");  
        String string = x.toString();  
        String str = "-selfcq\\n";  
        int indexOf = string.indexOf(str);  
        indexOf += str.length();  
        int indexOf2 = string.indexOf("\\n", indexOf);  
        String ss = string.substring(indexOf, indexOf2);  
        System.out.println(ss);// 指定的名称selfcq下的参数值ss