Erros in trying to synchronize Eclipse workspace files across a Windows machine and an Ubuntu machine; which files must or must not be included?(尝试在 Windows 机器和 Ubuntu 机器上同步 Eclipse 工作区文件时出错;哪些文件必须包含或不能包含?)
问题描述
我一直在 Windows 机器上开发 Android 应用程序.现在我想在另一台 Ubuntu 10.04 LTS 机器上继续开发.我想在计算机之间移动,维护每台计算机上项目文件的最新副本.我正在使用 SpiderOak 创建用于开发的 Eclipse 工作区目录的同步.当文件从 Windows 机器复制到 Ubuntu 机器上并运行 Eclipse 时,出现错误,无法验证 java sdk 的路径,显示的路径是与 Windows 机器相关的路径.
I have been developing an Android app on a Windows machine. Now I would like to continue development on another Ubuntu 10.04 LTS machine. I would like to move between computers maintaining a recent copy of the project files on each computer. I am using SpiderOak to create a synchronization of the workspace directories of Eclipse which I am using for development. When the files were copied from the Windows machine onto the Ubuntu machine and I ran Eclipse, an error was presented that the path to the java sdk could not be validated and the path shown was the path relevant to the Windows machine.
有没有简单的解决方案?我可以想象一些关于工作空间细节的文件不应该被传输.我可以简单地省略传输 Eclipse 创建的每个工作空间中包含的 .metadata
文件夹吗?我对同步对应用程序的操作不重要的首选项/插件/部分不感兴趣.从同步中排除 .metadata
是否会造成另一个问题,即无法传输有关正在开发的 Android 应用程序的有价值信息?
Is there a simple solution to this? I can imagine that some files regarding the workspace specifics should not be transferred. Can I simply omit transferring the .metadata
folder contained in each workspace created by Eclipse? I am not interested in synchronizing preferences/plugins/parts not essential to the operation of the app. Will excluding the .metadata
from the sync create another problem in not transferring valuable information regarding the Android app being developed?
推荐答案
只要我手头有我的项目源代码,我永远不会考虑同步Eclipse工作区目录进行跨平台开发.正确的方法是单独维护您的源代码(分开,我的意思是不要将您的源代码绑定到任何操作系统上的任何 IDE,如果条件允许,始终建议使用版本控制系统),无论您想通过 Eclipse 还是 IntelliJ 开始开发,在 Windows、Linux 或 Mac 上,获取源代码副本并将其导入 IDE.
As long as I have my project source code on hand, I will never consider synchronizing Eclipse workspace directory for cross-platform development. The correct way is maintain your source separately (by separately, I means do not bind your source to any IDE on any OS, use version control system is always recommended if the condition allows), wherever your want to start development by Eclipse or IntelliJ, on Windows, Linux or Mac, get a copy of you source and import it into your IDE.
通常,使您的项目成为 Android 项目的唯一文件是:
Generally, the only files that makes your project a Android Project are:
- src/
- res/
- 资产/
- lib/(如果你导入外部 jar 库)
- AndroidManifest.xml
- project.properties(或 default.properties,自 r14 起重命名)
- proguard.cfg(如果您使用 Proguard)
如果您在团队中工作并使用 SVN 之类的源代码管理,则只有这些文件夹/文件需要签入 SVN,所有其他文件夹/文件(.project、.classpath、.settings/、bin/、target/和等)是不必要的.这些是在导入和构建项目时由 IDE 迭代生成的.
If you work within a team and use source control like SVN, these are the only required folders/files that need checked in to SVN, all others (.project, .classpath, .settings/, bin/, target/ and etc.) are not necessary. thoese are iteratively generated by IDE when import and build your project.
这适用于所有三种 Android 项目类型(Android 项目、Libaray 项目和测试项目),如果您熟悉 Ant 或 Maven 等其他构建工具,它也可能对您维护跨平台开发有很大帮助.
This applies to all three Android project type (Android Project, Libaray Project and Test Project), If you are familiar with other build tools like Ant or Maven, it may also helps you a lot to maintain cross-platform development.
这篇关于尝试在 Windows 机器和 Ubuntu 机器上同步 Eclipse 工作区文件时出错;哪些文件必须包含或不能包含?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:尝试在 Windows 机器和 Ubuntu 机器上同步 Eclipse 工作区文件时出错;哪些文件必须包含或不能包含?
基础教程推荐
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01