2

I have recently switched from Eclipse Indigo to Eclipse Juno. My thinking was I could just point it at the same workspace I was working with in Indigo. This did work to bring in my project (which is disbursed across several packages), however I now get 176 errors, mainly these two:

The project cannot be built until build path errors are resolved

Unbound classpath variable:'M2_REPO/com/some_path/some.jar' in project 'my_project'

Any ideas as to how I can resolve this? Id really prefer to use Juno.

James McMahon
  • 48,506
  • 64
  • 207
  • 283
Houdini
  • 3,442
  • 9
  • 31
  • 47
  • Did you try adding the classpath variable M2_REPO to the workspace again? – Rajesh J Advani Aug 07 '12 at 12:37
  • I think you can export the preferences from eclipse Indigo and import them to Eclipse Juno and this includes all the path variables etc. If you had everything working in Eclipse Indigo, then just open Eclipse Indigo and export (File->Export->General-Preferences select Export All) the preferences to a file (name.epf)and import them into the new eclipse version by File->import->General_Preferences – htulsiani Aug 07 '12 at 12:49

2 Answers2

3

What is the M2_REPO Variable ?

Excerpt from here :

M2_REPO is a variable that defines where maven repository is on your disk

Check Maven Settings

I recommend that you check whether your Maven installation is setup properly. Did you use to have the m2e plugin in the old eclipse ? If so, might be worth checking whether there is the same in Juno. Do you see a 'Maven' option in preferences ? If so, check the following Preferences -> Maven -> Installations :

Maven

If that plugin is present and setup properly you should already have an M2_REPO variable. If not, try adding the current maven installation you have.

Adding M2_REPO Manually

If the maven settings are all ok, you can add the M2_REPO classpath variable manually as follows.

Goto Preferences -> Java -> Build Path -> Classpath Variables and add a New Entry by clicking on New and then enter the following details :

Name = M2_REPO 
Path = C:\Users\jindala\.m2\repository

Once you do that your Classpath Variables dialogue should look like this :

Add workspace variable

Community
  • 1
  • 1
Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91
  • That worked mint, you are awesome thanks! Your picture gave me the genius idea to look at Indigo settings, see what classpath variable I was missing, and add it to Juno. – Houdini Aug 07 '12 at 12:59
  • @Houdini, awesome !! I am happy to know that your problem is solved now :) – Ashutosh Jindal Aug 07 '12 at 13:01
0

If you had everything working in Eclipse Indigo, then just open Eclipse Indigo and export (File->Export->General-Preferences select Export All) the preferences to a file (name.epf)and import them into the new eclipse version by File->import->General_Preferences

htulsiani
  • 344
  • 1
  • 8