maven project import to eclipse problems

Hi,

maven project importing to eclipse giving attached problems.
when i went to project properties---java compiler i see 1.4.

How to change to 1.7 in eclipse. Do i need to download JDK 1.7 for that.
when i see the java build paths shows j2se1.4.

when i see target runtime i see JRE 1.8.

Please advise
Problems.png
Problems2.png
Problems3.png
Problems4.png
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
Add a section like this into your maven pom.xml file...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

Open in new window


And then right-click on your project, goto "Maven" and then "Update Project..."

And yes, if you want to develop against Java 1.7 you will need a 1.7 version of JDK (it appears that you may have 1.8 installed, so you could try changing the above maven pom.xml snippet to 1.8 too)
0
gudii9Author Commented:
do i need to  change your default compiler to 1.7 or 1.8

for this i need to down load jdk 1.8 or 1.7 on to my windows 7 laptop and then change the JAVA_HOME from Systeme Variables--->Advanced Variables to set to JDK1.8 which i just downloaded right?

Maven project pom.xml says

 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

i feel to many places to change makes it more error prone as we may miss in any one of above 5 places namely

1. eclipse java compiler
2. eclipse jre runtime(can i give jdk1.8 which any way has jre1.8 built in that right?? please advise)
3. eclipse project jre
4. windows laptop JAVA_HOME
5. pom.xml configuration entry
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
do i need to  change your default compiler to 1.7 or 1.8

That is up for you to decide which version you want to develop against.

Ok, these are the steps...

 - If you want to use 1.7 (as you have indicated in your pom.xml file) yes you need to download JDK 1.7 if you haven't already.

- In Eclipse, follow these menus... "Window" -> "Preferences" and then find on the left "Java" -> "Installed JREs". Make sure there is an entry for the 1.7 version, if there isn't "Add.." one to point to your newly installed jdk_1.7XXXX directory.

- With your pom.xml as above, simply right-click on your project, go to "Maven" -> "Update project..." and your Eclipse project settings (ie. what java version to use) will be set based on the values in your pom.xml.

That's all you have to do. Referencing your 5 points from above, yes you have to do 5. But points 1, 2 , 3 are handled by the one simple "Update Project..." action as above, and point 4 you don't need to worry about. So, no I don't think it IS too many steps to worry about. And it is not error prone, because you set it in 1 place and then "Update Project..." and all is set correctly.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

gudii9Author Commented:
- In Eclipse, follow these menus... "Window" -> "Preferences" and then find on the left "Java" -> "Installed JREs". Make sure there is an entry for the 1.7 version, if there isn't "Add.." one to point to your newly installed jdk_1.7XXXX directory
i was just checking other  laptop which has RSA8.5.

It does not point to any installed jdk instead it points to different jdk.
when i try to add it gave 3 options like

standard vm
standard 1.1 vm
execution env description etc

what each above selection means.

Which one to select. please advise
installedJRE.png
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
I've always just left it as "Standard VM" and haven't had any problems. I haven't ever looked into what that truly means though.
0
gudii9Author Commented:
I changed to default JRE1.8.0_25 as attached. I still have 64 errors complaining you need to have 1.5 and more. Do i need to change JDK as well somewhere apart from JRE?




Here is other screen how it was looking originally(1.4 not sure why eclipse took 1.4 at start up instead of taking from JAVA_HOME?) before change.

Please advise
JREEclipse4.png
JREEclipse3.png
JREEclipse2.png
JREEclipse.png
0
gudii9Author Commented:
maven i changed to 1.8 as below

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.2</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<webXml>src/main/webapp/WEB-INF/web.xml</webXml>

				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-codegen-plugin</artifactId>
				<version>${cxf.version}</version>
				<executions>
					<execution>
						<id>generate-sources</id>
						<phase>generate-sources</phase>
						<configuration>
							<sourceRoot>${basedir}/src/generated</sourceRoot>
							<wsdlOptions>
								<wsdlOption>
									<wsdl>${basedir}/src/main/webapp/WEB-INF/wsdl/CustomerOrders.wsdl</wsdl>
								</wsdlOption>
							</wsdlOptions>
						</configuration>
						<goals>
							<goal>wsdl2java</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>

		<finalName>wsdlfirstws</finalName>
	</build>

Open in new window


then right clicked on project-->maven-->update project that reduced one error but i still have 63 errors though. please advise
updateProject.png
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
In the first screenshot (JREEclipse.png) you somehow have a v1.4 environment setup with a v1.8 jre? Don't know how you managed to do that, but try changing that from "Execution Environment" to the workspace default jre1.8 option.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
As given in below link

http://stackoverflow.com/questions/19382370/openjdk-1-7-in-eclipse-operator-is-not-allowed-for-source-level-below-1-7 

i went to my specific project and preferences. I see compiler drop down allowing only till 1.7 but not 1.8. How to enable 1.8


when i right clicked project -->properties--->compiler--->i see 1.4 which is causing errors looks like.

when i click the buildpath link there it showed other screen with 1.4

How to change in the build path from 1.4 to 1.8. Do i need to click 'add library'?

Please advise
ProjectPreferences.png
ProjectProperties.png
ProjectPropertiesBuildPAth.png
0
gudii9Author Commented:
i went to
window-->preferences--clicked 'project specific settings'-->gave 1.7 as attached(i cannot see 1.8 not sure how to enable that..is it is due eclipse keplon wont support 1.8???)

after saving my errors reduced to 2

how to resolve those two as well.

Please advise
ProjectSpecificSettings0.png
ProjectSpecificSettings1.png
ProjectSpecificSettings2.png
0
gudii9Author Commented:
when i changed web.ml version to 3.0 from 2.5 and did right clicked on project
maven--->update project

all 63 errors came back

I tried other solutions here but not working
http://stackoverflow.com/questions/18122336/cannot-change-version-of-project-facet-dynamic-web-module-to-3-0


I think I had the same problem as you. my web.xml had version 2.5 while the project had the (right-click on Project-> Properties-> Progect Facets->) Dynamic Web Module 2.3. Although I tried to change the version from 2.3 to 2.5 ECLIPSE did not permit it. Solution: I removed the check mark under the heading Dynamic Web Module, I saved and I had Update Project. Automatically re-awakening is entering the box with the correct version. I use Eclipse Kepler.

i tried above but no luck
as heading Dynamic Web Module, do not have any check box in first place for me.
webXml3.png
webXml3-2.png
0
gudii9Author Commented:
i have to change project specifi settings to come back to 2 errors.

i saw this post

http://stackoverflow.com/questions/18122336/cannot-change-version-of-project-facet-dynamic-web-module-to-3-0

they are saying change eclipse.ini

Imporing simple webservice web projectg in a eclipse can go as complex as this sometimes which i really wonder power and craziness of java
0
gudii9Author Commented:
when i insalled eclipse mars and then tomcat 8 and imported project no errors finally. thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.