Amazon web services 如何在使用较旧的(非builder())AWS api时设置AWS区域

Amazon web services 如何在使用较旧的(非builder())AWS api时设置AWS区域,amazon-web-services,Amazon Web Services,我尝试了BasicAWSCredential和PropertiesCredentials。它们具有相同的结果: com.amazonaws.SdkClientException: Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region. 现在的复杂情况是-与具有以下功

我尝试了
BasicAWSCredential
PropertiesCredentials
。它们具有相同的结果:

com.amazonaws.SdkClientException: Unable to find a region via the region provider chain. 
Must provide an explicit region in the builder or setup environment to supply a region.
现在的复杂情况是-与具有以下功能的较新SDK不同:

 setRegion
老的没有。我不需要使用文件系统,因此无法创建凭据文件:是否有任何仅使用内存的方法可以在这里工作