Попробуйте опцию -xx:-useperfdata
, следующее могло бы быть полезным, который является из ссылки https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html
-XX:+UsePerfData
Enables the perfdata feature. This option is enabled by default
to allow JVM monitoring and performance testing. Disabling it
suppresses the creation of the hsperfdata_userid directories.
To disable the perfdata feature, specify -XX:-UsePerfData.
Вы можете создать свой собственный настраиваемый раздел конфигурации в файле app.config. Существует довольно много нескольких руководств вокруг , которые помогут вам начать работу. В конечном итоге у вас может быть что-то вроде этого:
<configSections>
<section name="backupDirectories" type="TestReadMultipler2343.BackupDirectoriesSection, TestReadMultipler2343" />
</configSections>
<backupDirectories>
<directory location="C:\test1" />
<directory location="C:\test2" />
<directory location="C:\test3" />
</backupDirectories>
В дополнение к ответу Ричарда, это C #, который вы можете использовать с его образцом конфигурации:
using System.Collections.Generic;
using System.Configuration;
using System.Xml;
namespace TestReadMultipler2343
{
public class BackupDirectoriesSection : IConfigurationSectionHandler
{
public object Create(object parent, object configContext, XmlNode section)
{
List<directory> myConfigObject = new List<directory>();
foreach (XmlNode childNode in section.ChildNodes)
{
foreach (XmlAttribute attrib in childNode.Attributes)
{
myConfigObject.Add(new directory() { location = attrib.Value });
}
}
return myConfigObject;
}
}
public class directory
{
public string location { get; set; }
}
}
Затем вы можете получить доступ к разделу конфигурации backupDirectories следующим образом:
List<directory> dirs = ConfigurationManager.GetSection("backupDirectories") as List<directory>;
Их можно разделить точкой с запятой в одном значении, например
App.config
<add key="paths" value="C:\test1;C:\test2;C:\test3" />
C #
var paths = new List<string>(ConfigurationManager.AppSettings["paths"].Split(new char[] { ';' }));