- This topic has 3 replies, 2 voices, and was last updated 13 years, 10 months ago by Nehal Vaidya.
-
AuthorPosts
-
Nehal VaidyaMemberHello!
I am trying to make my Java 1.4 project to work inside MyEclipse for Spring. I’ve set the compiler level to 1.4
Am using a Ant build script for the build. The version of spring.jar is 2.5.2
How do I force the compiler to load the spring 2.5 jar instead of spring 3.0 jars
Interestingly, the ant build is loading the spring 2.5 jar from my lib folder as shown below but the javac compiler is loading the 3.0 jar.[javac] [loading …\include\lib\spring.jar(org/springframework/dao/support/DaoSupport.class)]
[javac] [loading ..\projects\.metadata\.plugins\org.springframework.ide.eclipse.osgi.targetdefinition] –>.3.2.201003220227-RELEASE\target\org.springframework.beans-3.0.1.RELEASE-A.jar(org/springframework/beans/factory/InitializingBean.class)]
[javac] ..\projects\xxxxxxDAO.java:40: cannot access org.springframework.beans.factory.InitializingBean
[javac] bad class file: ..\projects\.metadata\.plugins\org.springframework.ide.eclipse.osgi.targetdefinition] –>.3.2.201003220227-RELEASE\target\org.springframework.beans-3.0.1.RELEASE-A.jar(org/springframework/beans/factory/InitializingBean.class)
[javac] class file has wrong version 49.0, should be 48.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.Thanks in advance,
Nehal
jkennedyMemberNehal,
Did you apply any classpath containers or capabilities to the project?It isn’t clear to me how the javac that is being called from Ant would be getting a reference to the Spring 3.0 libs unless they were being setup on your project somewhere and included in the classpath that is being passed to javac.
You can send me your project at jkennedy@skywaysoftware.com if you like and I can take a look.
Thanks,
Jack
Nehal VaidyaMemberHello Jack,
Thanks for responding..
I’ve not applied any capabilities to the project. I am including the spring 2.5 jar manually to my classpath. Now, I do not have much experience with OSGI (read none) but it looked like the following two folders got created in my plugins directory of the project when I launched the IDE.
org.springframework.ide.eclipse.aop.core
org.springframework.ide.eclipse.osgi.targetdefinition
\2.3.2.201003220227-RELEASE
\targetThe Spring libraries in the target folder referred to 3.0 release (org.springframework.beans-3.0.1.RELEASE-A.jar) which was causing the issue.
The following plugin was set to be activated on startup “Spring Dynamic Modulesfor OSGI(tm) Service PLatform Target Definition” which created the additional folders. Once I deactivated the plugin on startup and restarted the IDE, the folders were not being craeted.
I was able to compile my project successfully.So am not sure what the root cause is but was able to work around it by forcing MyEclipse not to load the Spring DM for OSGI plugin.
Thanks,
Nehal
Nehal VaidyaMember<correction>
The folder created in the plugin folder is
org.springframework.ide.eclipse.osgi.targetdefinition \ 2.3.2.201003220227-RELEASE \ target -
AuthorPosts