Why does Eclipse showing errors when I load my workspace on a different computer?
I have the Eclipse compiler saved and booting from my portable HDD as well as it's workspace. I was working on my assignment at school and had to leave. I saved my work and checked to make sure it was on the drive. It was so I disconnected the drive and left. Now that I'm home, I load my workspace and it has errors everywhere. Even the import codes are showing errors.
Does anyo开发者_如何转开发ne know or have an idea as to what's going on and how to fix it? Everything is loading and running from the portable HDD so the actual computer shouldn't have anything to do with it. The assignment is due soon and I need to have this fixed asap.
Thanks in advance for any assistance.
Could the drive be registering with different labels on the different computers (eg G: on one and H: on the other)? Maybe there are some hard coded paths that are causing you problems.
Possible cases
- JDK/JRE paths in both machines do not match.Go to Windows -> Preferences -> Java -> Installed JREs. Check if the JDK/JRE location is same as your installation path.
- Path for external jars added to your build path do not match. Right click on your Project ->Properties -> Java Build Path -> Libraries.Check jar locations.
Perhaps you have a different JDK? I know that I have issues when switching between my Mac 10.5 desktop (Java 1.5) and Mac 10.6 laptop (Java 1.6) unless I explicitly tell Eclipse to use a certain JDK via the "Installed JREs" pref
Depends on what kind of project you are doing! Check for any hard coded paths, the imports that you could have made in your projects. See where u need to reset the path where you have made the imports.
Here are the some steps If you want to move your project to one PC to other, hope this help. When you are copy to Pen drive or Hard drive follow these steps
- Open Eclipse and switch to Workspace1 using Switch To Workspace...
- Check the projects in Workspace1
- Switch to another workspace to make sure that Workspace1 is closed completely by Eclipse (Critical step!)
- Quit Eclipse
- Copy Workspace1 and name the copy Workspace2
- Copy Workspace2 to a USB flash drive
- Copy Workspace2 from the USB flash drive onto the hard disk of a different computer
- Open Eclipse on the new computer
- Switch to Workspace2 using Switch To Workspace...
The projects open normally from Eclipse on any machine as though that workspace had been there all along. The critical step seems to be switching to another workspace before quitting Eclipse. If you skip that step the copied and transferred workspace does not open correctly.
精彩评论