当前位置: 代码迷 >> Eclipse >> Eclipse Android 插件安装有关问题
  详细解决方案

Eclipse Android 插件安装有关问题

热度:101   发布时间:2016-04-23 13:29:26.0
Eclipse Android 插件安装问题

安装Android出现了如吐问题,怎么解决啊?

------解决方案--------------------
把插件下载下来装,在线装很容易出这个问题,
------解决方案--------------------
下载后解压缩,找到bundles.info文件
1) 首先bundles.inf文件在myeclipses安装目录下的\configuration\org.eclipse.equinox.simpleconfigurator文件夹下。最好先备份一下。 
2) 然后你可以在myeclipse下建立一个文件夹myplugin来存放你需要安装的插件,将你需要安装的插件放到这个目录下。 
3)然后新建一个java文件,创建如下内容 
Java代码:
 
import java.io.File;
import java.util.ArrayList;
import java.util.List; 
public class PluginConfigCreator

public PluginConfigCreator()
{
}
  
public void print(String path)
{
List<String> list = getFileList(path);
if (list == null)
{
return;
}
  
int length = list.size();
for (int i = 0; i < length; i++)
{
String result = "";
String thePath = getFormatPath(getString(list.get(i)));
File file = new File(thePath);
if (file.isDirectory())
{
String fileName = file.getName();
if (fileName.indexOf("_") < 0)
{
print(thePath);
continue;
}
String[] filenames = fileName.split("_");
String filename1 = filenames[0];
String filename2 = filenames[1];
result = filename1 + "," + filename2 + ",file:/" + path + "\\"
+ fileName + "\\,4,false";
System.out.println(result);
} else if (file.isFile())
{
String fileName = file.getName();
if (fileName.indexOf("_") < 0)
{
continue;
}
int last = fileName.lastIndexOf("_");// 最后一个下划线的位置
String filename1 = fileName.substring(0, last);
String filename2 = fileName.substring(last + 1, fileName
.length() - 4);
result = filename1 + "," + filename2 + ",file:/" + path + "\\"
+ fileName + ",4,false";
System.out.println(result);
}
  
}
}
  
public List<String> getFileList(String path)
{
path = getFormatPath(path);
path = path + "/";
File filePath = new File(path);
if (!filePath.isDirectory())
{
return null;
}
String[] filelist = filePath. list();
List<String> filelistFilter = new ArrayList<String>();
  
for (int i = 0; i < filelist.length; i++)
{
String tempfilename = getFormatPath(path + filelist[i]);
filelistFilter.add(tempfilename);
}
return filelistFilter;
}
  
public String getString(Object object)
{
if (object == null)
{
return "";
}
return String.valueOf(object);
}
  
public String getFormatPath(String path)
{
path = path.replaceAll("\\\\", "/");
path = path.replaceAll("//", "/");
return path;
  相关解决方案