简体   繁体   中英

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 anyone 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.

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

  1. Open Eclipse and switch to Workspace1 using Switch To Workspace...
  2. Check the projects in Workspace1
  3. Switch to another workspace to make sure that Workspace1 is closed completely by Eclipse (Critical step!)
  4. Quit Eclipse
  5. Copy Workspace1 and name the copy Workspace2
  6. Copy Workspace2 to a USB flash drive
  7. Copy Workspace2 from the USB flash drive onto the hard disk of a different computer
  8. Open Eclipse on the new computer
  9. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM