Tag Archives: eclipse

Eclipse failed to start. Javax / annotation / postconstruct is missing

Open source software supply chain lighting plan, waiting for you>>>

Just now I started eclipse (neon version), but it couldn’t start normally, and then a pop-up box appeared

View log file

Extract part of the log

!SESSION 2018-03-07 18:45:23.034 -----------------------------------------------
eclipse.buildId=4.6.2.M20161124-1400
java.version=9.0.4
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.osgi 4 0 2018-03-07 18:45:28.474
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:490)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:504)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:203)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:632)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
	... 23 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 25 more

It is said on the Internet that the reason is caused by jdk9, and the solution is given:

Find eclipse installation path

Add a sentence:

--add-modules=ALL-SYSTEM

Save and restart eclipse

Eclipse startup error: JVM terminated. Exit code = 13

Open source software supply chain lighting plan, waiting for you>>>

The previous JDK used openjdk1.7, which comes with openSUSE; After that, it was changed to jdk-6u38-linux-i586-rpm.bin under the official Oracle website. As a result, eclipse could not be started, and an error was reported: JVM terminated. Exit code = 13

Check the information, may be the JDK version is not compatible with the system and eclipse, eclipse is x86_ 64 64bit

Jdk-6u38-linux-i586-rpm.bin is 32-bit, then change to jdk-6u38-linux-x64-rpm.bin

Problem solving

[Solved] maven 3.5.0 combined with eclipse suggests solutions to lambda expressions are allowed only at source level 1.8 or above errors

Error recurrence

I installed maven 3.5.0 on my machine and created a maven project in eclipse. Pom.xml is configured as follows:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>zhangchao</groupId> <artifactId>testVertx</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <!-- 一些依赖 --> </dependencies> </project>

Right click the project – > Maven -> Update Project … -> The OK code always gives error prompts, which are as follows: lambda expressions are allowed only at source level 1.8 or above

Solutions

To change the pom.xml configuration, there are two key statements:

<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target>

Add these two statements to the properties tag pair, and the changed code is as follows:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>zhangchao</groupId> <artifactId>testVertx</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <!-- 一些依赖 --> </dependencies> </project>

Right click the project again – > Maven -> Update Project … -> OK 。
if update project doesn’t work, right-click – > Run as -> Maven build… -> In goals, enter clean compile – > RUN

There should be no error prompts at this time

Open eclipse and pop up the solution of “no Java virtual machine was found…”

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Open eclipse and pop up the solution of “no Java virtual machine was found…”

Reference article:

(1) Open eclipse and pop up the solution of “no Java virtual machine was found…”

(2) https://www.cnblogs.com/fengchuiyangliu/p/6912875.html

Let’s make a note.

Using eclipse optimizer for eclipse

JavaScript implementation: how to write beautiful conditional expression>>>

Original text synced to http://www.waylau.com/about-optimizer-for-eclipse/

##Introduction to optimizer for eclipse

Official website: http://zeroturnaround.com/free/optimizer-for-eclipse/

As the name suggests, optimizer for eclipse plug-in is mainly used to solve the problem of eclipse performance optimization

###1. Low memory allocation

A lower minimum heap size will cause the JVM to allocate additional memory. When you don’t have enough memory, the JVM with frequent garbage collection will slow down your experience

###2. Slow class verification

Class executes validation classes and plug-in classes in eclipse, which significantly slows down the startup of the JVM

###3. Big index and history

Over time, eclipse generates a huge cache of history and index files. These files in RAM and SSD hard disk make eclipse slow and unresponsive

<!– more –>

###4. JDK is slow

Oracle JDK is the performance leader and continues to improve every release. If you don’t use this version, you miss it

###5. Eclipse is out of date

Eclipse is trying to get better with every new version. Keep your eclipse up to date and benefit from the latest improvements

###6. Lengthy build and deployment

Adding jrebel to your eclipse will allow you to immediately reload code, change running applications, eliminate the time wasted in application build, restart and redeploy

##Optimizer for eclipse installation

###Mode 1

Click “get your optimizer now” on the home page and drag the “install optimizer for eclipse” button to your eclipse. It will be installed automatically

###Mode 2

Search “optimizer for eclipse” in “open help → eclipse marketplace”. Click “Install”

###Mode 3

Add a repository in “open help → install new software”

Copy

http://update.zeroturnaround.com/free-tools/site/

Go to the dialog box and install

###Mode 4

Get offline package http://update.zeroturnaround.com/free-tools/site/update-site.zip . Unzip to the local. Link file to install

Where. Link points to the decompressed plug-in, and then put the. Link file in the dropins directory of the eclipse installation directory

##Using optimizer for eclipse

On the right hand side, there are corresponding options that need to be optimized

Click options, and then click “restart eclipse” to restart eclipse

When you enter eclipse again, you can see the performance improvement. You can choose to quit optimizer or continue to optimize

You can find the optimizer control page in “open help → optimizer for eclipse”

Remote System Explorer operation always runs background services, blocking eclipse solution

I just started my android project. I found that when you edit the Android interface using the visual editing interface, when you right-click to edit the ID or other properties of the control, you will get stuck for a long time. I found that the eclipse background process was operating remotely, which is the “Remote System Explorer operation” displayed in the lower right corner. After struggling for a long time, I found the answer (source address) in stack overflow. Translate the solution as follows:

Step 1: Eclipse – > Preferences -> General -> Do not check the RSE UI.
Step 2: Eclipse – > Preferences -> Remote systems. Uncheck re open remote systems view to previous state.
finally: restart eclipse
P.S: do you want to develop or use Google more?Go to foreign language websites to see examples

When eclipse writes CPP, symbol “cout” could not resolved appears

 

Error: Launch failed.Bianry not found

A program file was not specified in the launch configuration

The solution to the above error is to build the project first. Specifically, press Ctrl+B at the same time, or press the button circled in the red box in the figure.

 

 

Then press the Run button again, and the program can be executed normally. As shown in the figure below, the content enclosed by the red frame is the execution result of the program.

 

 

The full text is over.

About eclipse new web project, prompt: “the superclass” javax. Servlet. Http. Httpservlet “was not found on the Java” solution

New jsp page always prompts.

Multiple annotations found at this line:

– The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

Solution steps.
1. Right click on the project-build path

2. Select configure build path…

3. Select java build path

4. Add Library –> server Runtime -> Click Next

5. Select Server runtime (My Version is Tomcat 7.0) –>Done