Tag Archives: eclipse

Eclipse gets stuck saving copy and paste

When editing long code in eclipse, eclipse often gets stuck for a long time when using Ctrl.  
the guess is that you can click and jump to the variable definition after holding down Ctrl in eclipse, so when you press Ctrl, eclipse will generate this mapping. When the file is large, this behavior will take a lot of time. You can set shortcut keys by the following methods.  

Eclipse — Windows-> Preferences-> General-> Editors-> Text Editors-> Hyperlinking:  
Remove this option: enable on demand hyperlinks style navigation  

Eclipse create servlet file error

When creating a web project in eclipse, an error is reported when creating a JSP or servlet file, as follows:

the error is: the superclass“ javax.servlet.http . httpservlet “was not found on the Java build path“ javax.servlet.http The. Httpservlet “class cannot be found in the project’s build path, that is, there is no class to send and receive requests.
If you look at the error reported by the servlet file:

is also the error caused by the lack of servlet related classes.
The specific solution is:
right click on the specific project — & gt; select Properties — & gt; select “Java build path”, and then follow the steps below:

Click next, select the server, click Finish

and then click “apply and close”.

Eclipse PyDev “interpreter does not exist in filesystem”

The reason for the problem: this kind of problem is generally should be will python.exe The file has been renamed

Solution: there are generally two ways:

1: change the file name back (basically, it won’t be changed back, because the file name is usually changed to include both python2 and python3 on the computer. In order to add environment variables and successfully run two different versions of python, the file name is usually changed)

2: modify the python path of eclipse

Modify in window – & gt; preferences – & gt; pydev – & gt; interpreters – & gt; Python interpreter

      

Use the remove button to delete the paths of the two Python versions, then click browse for Python/pypy exe, re select the path of python, and finally click apply and close

 

At this time, the project file still reports an error. At this time, select the project that reports an error, right-click and select the properties option – & gt; pydev interpreter/grammar, then switch to interpreter and select the corresponding Python Version (default)– currently:python2 Finally, click apply and close. Finally, restart eclipse

    

The solution of a Java exception has occurred. And error exception in thread when eclipse runs

This problem is caused by a Java class file compiled by a higher version of JDK trying to run on a lower version of JVM.

1. The solution is to ensure that the versions of JVM (Java command) and JDK (javac command) are consistent. If it is the Linux version, enter the Java – version and javac – version commands in the command line to see if the versions are consistent. I use 1.7.0_ 80。

 

2. The same version still can’t solve the problem. I don’t compile with javac directly from the command line, but with eclipse compiler. Because many compilers come with javac, rather than using the compiler in the operating system. If your compiler is eclipse, you need to set the JDK version in the properties of the project. The method is to right-click the project — & gt; properties — & gt; Java compiler — & gt; enable project specific settings — & gt; and set the compiler compliance level to 1.7, which is the version consistent with the JVM (the version shown by Java – version in the command line). Because of the need to be compatible with other software before, I reduced the Java version from 1.8 to 1.7, but eclipse did not move, so after opening it, I found that the default was 1.8, so I manually reduced it to 1.7, recompiled it, and finally passed!

 

To sum up, if you are compiling with a compiler, make sure that the JDK version of the compiler is consistent with the Java version of the operating system.

The screenshot is as follows:

The solution of red X in eclipse error pages

Every time I build a maven project and turn it into a web project, there are always so many files here, and there will also be a red cross of error pages, which is very uncomfortable. Although there was no error in the project, it was always an error message for me. So I looked for a long time, and finally found the cause of the problem.

It turns out that this is a problem of eclipse itself. If you change to a web project, you will add web.xml , but the compiler will not update itself and will report this error. So you can cut it web.xml Save all the information in Ctrl + s, then the compiler will refresh, and then you are putting the clipped content back web.xml Finally, the problem is solved.

 

Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…

[operation environment]

jdk1.8+eclipse+apache tomcat v7.0

 

[phenomenon]

Code running error org.apache.catelina . core.StandardContext listenerStart

Error creating bean with name ‘sqlSessionFactory’ defined in URL [file:/E:/apache-tomcat-7.0.63-windows-x64

 

Tomcat error

 

Reason: no Tomcat jar package added

Select the project, right-click, select build path — & gt; add Libraries… — & gt; select server runtime — & gt; next — & gt; select Apache Tomcat v7.0 — & gt; OK.

 

 

 

 

 

Eclipse report error Error:opening registry key ‘Software/JavaSoft/JRE’

I want to taste the latest jdk10, Since Java removed the generation of JRE directory in JDK folder when it was installed from java9, and gradle was not compatible with JDK installation mode without JRE folder, it had to switch back to java8, so after repeatedly unloading and reinstalling JDK, an error occurred when starting eclipse Error:opening registry key ‘Software/JavaSoft/JRE’

The error information is as follows:

Please click to input the picture description

Please click to input the picture description

Please click to input the picture description

Please click to input the picture description

Obviously, the system does not find the JRE, and the current java version is still not displayed in the CMD – & gt; Java – version. Of course, the environment variable Java_ Home and path are checked correctly. It is suspected that Java is not found correctly due to cache or registry_ Then, with the mentality of having a try, compare the previous environment variable name with the “Java” in the path_ The key value of “home” is replaced by the uppercase “Java”_ “Home” has been changed to lowercase “Java”_ Then CMD – & gt; Java – version can display the information of jdk8 normally, restart eclipse, perfect solution! Share here, hope to help you!

Error: could not create the Java virtual machine Error:A Fatal exception has occurred

The error report is as follows:

Prompt that the Java virtual machine could not be created successfully.

The main reason for the above error is that eclipse can’t find the JDK installed on the machine when it starts (if it doesn’t install, please go to Baidu installation tutorial to install it). At this time, we need to manually guide eclipse to load the JDK path.

Open the eclipse installation path and find the eclipse.ini File, pay attention to open the file suffix display, as shown in the following figure:

Open with Notepad + + and other text editing tools eclipse.ini File:

Add two lines of code out of the rectangular box in the file, pay attention to the path, fill in the bin directory under the JDK installation path of your own machine, save and restart eclipse. This problem can be solved.

Successful solution of eclipse startup error Error:Could not create the Java Virtual Machine Error:A fatal exception has occurred

Error reporting process

Today, after opening eclipse, the following error occurred

problem analysis

The system is reinstalled on the computer, and then Java is also reinstalled. Useless files are generated in the computer’s C: [windows] system32, as shown in the following figure:

Problem solving

Just delete the three files above

OK, GAME OVER !

More wonderful content please pay attention to: the road of Java master

Reply to “java project” and get the following video tutorial for free

pom.xml Depending on the error report, the problem of missing artifact XXX is solved

pom.xml Depending on the error report, the problem of missing artifact XXX is solved

Possible causes pom.xml The dependency configuration format specifies that you manually download the corresponding jar and then install it to the local repository pom.xml After modification

Eclipse imports or creates a new Maven project, pom.xml An error is reported in the configuration file, missing artifact XXX jar. The problem is that the jar package is not found in the specified warehouse after Maven is started.

Possible causes

    there is no such jar package in the central warehouse or local warehouse; some jar packages are charged (for example, Oracle) ojdbc.jar In fact, there is no such resource in Maven Central Library, so it cannot be loaded; pom.xml Configuration items do not match.

pom.xml Dependency configuration format description

// pom.xml
<dependencies>
		<dependency>
			<groupId>Package1</groupId>
			<artifactId>jarName</artifactId>
			<version>versionInJar</version>
		</dependency>
		<dependency>
			<groupId>Package2</groupId>
			<artifactId>jarName2</artifactId>
			<version>1.0.0</version>
		</dependency>
		......
</dependencies>

Groupid: the relative path of the dependent jar package. The parent-child directory is marked with “.” (example: package.packageNext ); artifactid: dependent jar package name; version: dependent jar package version.

Manually download the corresponding jar, and then install it to the local warehouse

    download the corresponding version of the jar package; open the CMD, preferably in the path to be installed (the installation command is more convenient, directly in the address bar of the path to be installed, enter CMD to quickly open the command window); install here. Take Ojdbc14 as an example, after opening CMD, enter the command as follows:

    mvn install:install-file -Dpackaging=jar -DgroupId= com.oracle -DartifactId=ojdbc14 -Dversion=11.2.0.3.0 -Dfile=ojdbc14-11.2.0.3.0.jar -DgeneratePom=true

    Command explanation:
    install: compile and package the project to the local warehouse;
    install file: install file;
    – dgroupid= com.oracle : Specifies that the groupid of the current package is com.oracle ;
    – dartifactid = Ojdbc14: Specifies that the current artifact ID is Ojdbc14;
    – dversion = 11.2.0.3.0: Specifies that the current package version is 11.2.0.3.0;
    – dversion = 11.2.0.3.0 -Dfile = D: ojdbc14-11.2.0.3.0.jar: Specifies the file location of the package to be typed (the reason why you want to open CMD in the path before is to avoid entering an excessively long path);
    – dgeneratepom = true: whether to generate a POM file.

      open the Maven project in eclipse, right-click Maven – & gt; update or click open pom.xml File, right-click Maven – & gt; update for project.

    pom.xml After modification

    <dependency>
    			<groupId>com.oracle</groupId>
    			<artifactId>ojdbc14</artifactId>
    			<version>11.2.0.3.0</version>
    </dependency>