Organize eclipse, upgrade the JDK environment small record

Source: Internet
Author: User
Tags apache tomcat

This 2 days in the finishing project:

Need to put eclipse 32-bit, jdk1.6 32-bit change to eclipse 64-bit, jdk1.8 64-bit version, so I was on a window7 computer directly operation, encountered a few questions, recorded:

    • A computer can be installed in multiple versions of the IDE tools, I installed the Eclipse 32-bit, eclipse64-bit, and MyEclipse 64-bit (recently organized desktop uninstall)
    • The original JDK is 1.6 32-bit, post-loaded 1.8 64-bit (this means that the computer supports multiple versions of the JDK runtime environment, respectively, under different folders, easy to switch)
    • When using jdk1.8, you need to change the java_home in the environment variable to a path of 1.8 and switch to several versions of the path using several versions.

There is a problem is that the low version switch to a higher version can be, the high version switch to the lower version will not come, so find data to solve

Put%java_home%\bin;%java_home%\jre\bin in the path, or go to the C-Disk--window--system32 folder to find Java.exe, Javaw.exe, Javac.exe Erase it.

1. Java.exe: Running Java program

2, Javac.exe: Compiled, generate. class file

3, Javaw.exe: As opposed to the Java command, when running the Java command, will appear and maintain a console window, the information in the program can be system.out in the console output

<!----------------------------------------After upgrading the JDK, Problems with importing 1.6 of STRUTS2 projects and how to fix them---------------------------------------! >

1. Import the project, change the upgraded jar package

2. Right-click on the project, select Build path--configure build path, as follows to change the latest JDK, and Tomcat

3.

4 According to the error place to try to modify the deletion

5. The project class file does not report an error, but the file name is still an error, check the place where the problems reported the Red fork, I here the wrong display is

Description Resource Path Location Type
Target Runtime Apache Tomcat v7.0 is not defined.gpsworkunknownfaceted Project problem

Workaround:

First, you can right-click on the Red Fork to delete (delete) But restart Tomcat will still exist, the project will still be error

Second, look directly under the eye-catching folder. Setting--org.eclipse.wst.common.project.facet.core. XML file--delete <runtime name= "Apache Tomcat v7.0"/> Just ok.

6. After the deletion succeeds, only Java resources error, the workaround is as follows:

Right-click the project selection Properties--java Compiler

Project errors are all solved.

7 Start the project, (and then the result gave me the wrong surprise )

Org.springframework.beans.factory.BeanDefinitionStoreException:Unexpected exception parsing XML document from file [D : \eclipseworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gpswork\web-inf\classes\ Applicationcontext.xml]; Nested exception is Java.lang.IllegalStateException:AnnotationAwareAspectJAutoProxyCreator are only available on Java 1.5 and higher

Workaround: Either fall back to version 1.6, and the second is to change the spring configuration file.

Change the header file of the Applicationcontext.xml file to the latest spring configuration

Then there's the problem:

1:16:35,770 ERROR Contextloader:351-context Initialization failed
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' sessionfactory ' defined in file [D:\EclipseWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gpswork\WEB-INF\classes\ Applicationcontext.xml]: Initialization of Bean failed; Nested exception is Java.lang.noclassdeffounderror:org/hibernate/cache/regionfactory

I think because the upgrade of the JDK version, updated the spring configuration, the associated Hibernat nature is also to be updated, so update to 3.5 of the Hibernat.jar package ...

Well, finally, this project will normally use the jdk1.8 environment.

Share someone else's: new features for each JDK version http://www.cnblogs.com/langtianya/p/3757993.html

Organize eclipse, upgrade the JDK environment small record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.