Tag Archives: eclipse

Eclipse’s shortcut Ctrl + Shift + F doesn’t work

format code (shortcut key for eclipse format code block: Ctrl + Shift + F)

1. Format java code:

①Ctrl+Shift+F

But will we encounter a time when pressing Ctrl + Shift + F doesn’t work
Ctrl + Shift + F is a simple and complex replacement in Sogou Pinyin. Once you install Sogou Pinyin, this shortcut key will be occupied, but you can set the simple and complex shortcut keys of Sogou for other users. In other cases, you can use the format shortcut in eclipse 2. The problem of the whole keyboard
3. The shortcut key of Ctrl + Shift + F is occupied by other software (such as Sogou Pinyin and Baidu Pinyin)

② Eclipse automatically formats code when saving files

many people don’t know that eclipse has a very useful function, that is, the function of automatically formatting source code. In general, people use Ctrl + Shift + F to format files manually, which is a waste of time.

In fact, eclipse already has an automatic formatting function. By default, this function is not available.

Specific method: Windows — > Preferences–> Java –> Editor–> Save actions. You can see the options on the right. Check “perform the selected actions on save”. You can select or configure other options according to your needs.

Don’t forget, finally, apply and OK.

2. Format XML code: Ctrl + Shift + F, but you need to make the following modifications

but for XML files, sometimes after formatting, the configuration attributes of a control are all packed in one line, which is very inconvenient to read and modify.

We hope that the best formatting effect is as follows: each property configuration of the control occupies one line, which is easy to read and modify, and the control without child elements can be used directly/> close:

<?xml version=”1.0″ encoding=”utf-8″?>

< LinearLayout xmlns:android= ” http://schemas.android.com/apk/res/android ”

android:layout_ width=”fill_ parent”

android:layout_ height=”fill_ parent”/>

android:text= “Some Content”

android:layout_ width=”wrap_ content”

android:layout_ height=”wrap_ content” />

</ LinearLayout>

In order to achieve the above formatting effect, you need to modify some configuration of eclipse and do some additional operations

modify the XML format configuration of eclipse

The configuration of this step is to make the formatting effect occupy one line for each property configuration of the control. Enter window/preferences and expand to XML/XML files/editor,

Check “split multiple attributes each on a new line”, as shown in the figure below:


< TextView android:id= “@+id/TextView01”

When using eclipse to compile projects with JNI, make: * no rule to make target ` all ‘. Stop. Solution appears

When using eclipse to compile projects with JNI, make: * no rule to make target ` all ‘. Stop. Solution appears

When using eclipse to develop JNI, which is developed by a third party, there are always exceptions as shown in the following figure

In case of the above error, the specific operation is as follows

1. Right click on the specific project and select properties

2. Then change the build command in the following screenshot to the relevant path of your local NDK. The specific screenshot is as follows

3. After the following operations, project clean again, and then compile OK

I hope the following will be helpful for you to develop under eclipse, although most of the projects have been migrated to Android studio

This article shares CSDN – it pioneer.

The difference between web app libraries and referenced libraries in eclipse project

Referencedlibraries is a jar package used in the compilation environment,
the so-called jar package used in the compilation environment means that when you write source files in eclipse, all the classes you need to refer to are taken from the jar package in the collection of referencedlibraries
/the jar package in Web inf/lib is the jar package used in the runtime environment. The so-called jar package used in the runtime environment is the collection of jar packages that you need to use when running your project

When I checked online, I said that the jar package under referenced libraries would not be packaged when the project was released. How could the project still run if it could not be packaged

1. Look at your runtime environment. There are some jars in the runtime environment, such as Tomcat’s own jars (such as servlet API)
2. There are some project management tools (such as maven, etc.) that will put all the packages you depend on into the war package. Please refer to the blog “what should be noticed when packaging Maven projects”
3. Some ide plug-ins are more intelligent. If the configuration is appropriate, the debugging runtime will automatically point to your compile time environment. Refer to the blog “developing a Jee project using eclipse’s maven2 plug-in”

Add referenced libraries:

Create a new lib folder under the project and put the jar in it. At this time, you just copy the jar package into the project and cannot use it. Then, right-click on the project name and select build path — & gt【 In the open window, first select the [libraries] page, and then click [add jars…] from the button on the right

Add web app libraries:

Put gson-2.2.4.jar package in webcontent – > WEB-INF-> Lib, it will be automatically compiled into the web app library

Remote System Explorer operation always runs background services and blocks eclipse

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

Eclipse can’t open, prompt could not open jvm.cfg error

What are the eight life cycle hook functions of Vue>>>

let’s start with : my problem is just my java_ JDK was originally installed in F:: temp, but I later changed this folder to F:: Java when I was sorting out files_ jdk。 So it leads to errors

Solution 1:

Because my only directory name changed, resulting in unable to find the file path, so the easiest way is to change the file path back (scared me not to change the file name in the future)_ T)

Solution 2:

An article of Baidu before me: Portal

First, open the directory location of the prompt to find out whether the file and folder exist. If it does not exist, it means that there is an error in the Java installation process and the corresponding file is not installed. You need to uninstall Java in the control panel and then re install it. That’s what happened to me

If the file exists, it can be said that the system cannot find it. There must be something wrong with the path saved in the registry or the median value of environment variables (at this time, you can change their values. If you don’t know what to change, you can see below)

file does not exist:

After uninstalling, visit the registry before re installing, delete the following information and click Start — > Run – > Enter regedit to open the registry

1、 Find HKEY_ LOCAL_ Machine/software/javasoft, just delete this javasoft. Javasoft normally includes at least three items: Java development kit, Java plug in, and Java runtime environment. Don’t be afraid. If you delete javasoft, you will delete all three items. The problem itself is here, so you need to delete the javasoft item

2、 Re install JDK (if you don’t change the file location, choose the default, that’s the best!) After reassembling, you will find that there is a new HKEY_ LOCAL_ Machine/software/javasoft, these parameters are new, there will be no problem

file exists:

This situation is mostly because JDK has been installed on the computer before. After unloading and reloading, running Java command will appear error:could not Error in open… Jvm.cfg. Open the system environment variable and view the path. You will see such configuration information

%SystemRoot%\system32;% SystemRoot%;……% JAVA_ HOME%\lib;% JAVA_ HOME%\bin

Reason: when running Java, the default is to find the java.exe file according to the path set in the path. According to the above path information, the first step is to find the file in the% systemroot% \ system32 directory, and the JDK installation directory corresponding to the java.exe in the directory has been unloaded. Naturally, the prompt that the file cannot be opened will appear

You may understand that there are two simple solutions

1. Directly delete java.exe under the system32 directory (or windows directory, depending on the path setting in the path) (in fact, if you look at the file date, you will find that the file date is different from that under the currently installed Java bin directory)

2. Direct% Java_ HOME%\bin; Put it at the front of the path (you know why)

After reading this article, you basically know how to install Java again_ When using JDK, you need to configure the path (registry and environment variables) of JDK. At this time, you can modify them

In my case, the easiest way is to change the file name back, but you can also find the registry and change the corresponding values of java development kit, Java plug in, and Java runtime environment (its value is a path point) and environment variables

[How to Solve] Eclipse: Errors occurred during the build

Errors occurred during the build.
Errors running builder 'Integrated External Tool Builder' on project 'xinghe-base'.
The builder launch configuration could not be found.
The builder launch configuration could not be found.
Errors running builder 'Integrated External Tool Builder' on project 'xinghe-base-web'.
The builder launch configuration could not be found.
The builder launch configuration could not be found.
Errors running builder 'Integrated External Tool Builder' on project 'xinghe-base-web'.
The builder launch configuration could not be found.
The builder launch configuration could not be found.
Errors running builder 'Integrated External Tool Builder' on project 'xinghe-manager-web'.
The builder launch configuration could not be found.
The builder launch configuration could not be found.
Errors running builder 'Integrated External Tool Builder' on project 'xinghe-manager-web'.
The builder launch configuration could not be found.
The builder launch configuration could not be found.

Description of the error environment:

Operating system: Windows 7 x64

Eclipse:

Eclipse Java EE IDE for Web Developers.
Version: Luna Service Release 2 (4.4.2)
Build id: 20150219-0600

apachetomcat 8.022

JDK 1.8

apachemaven 3.3.3

In order to speed up the compilation of the project, some validation and Builder have been removed, resulting in this error

The error is shown below.

Solution.

Click the right mouse button on the item with the error, and in the pop-up menu select Properties.

Select “Builders” on the left and delete the unavailable Builders on the right.

 

Eclipse online installation of fatjar and error resolution

After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>

eclipse online installation of fatjar and error resolution

I. eclipse version information

I am using the latest version of eclipse. The version information is as follows:

Eclipse Java EE IDE for Web Developers.

Version: Oxygen.2 Release (4.7.2)
Build id: 20171218-0600

2. Online installation steps of fatjar

In eclipse, follow these steps:

help -> To install new software, enter the following address in the work with input box:

http://kurucz-grafika.de/fatjar

Then enter and wait for installation. It takes a long time

The installation steps are very simple. This is online installation. If you use the copy method, there will be no error information even if there is an error and the installation fails. Online installation will give you error information. Therefore, online installation is recommended

After installation, you will see the option information as shown in the figure below in the preferences interface

This page is configured with the default options of the fatjar plug-in, which is fine by default

III. problems and Solutions

1. Problems

The following error was encountered during installation

Error message:

An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.

session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=, action=).
Error reading signed content.
Exception in opening zip file: D:\software\eclipse\plugins\net.sf.fjep.fatjar_0.0.31

2

1

I didn’t understand the specific reason for the above error information. At first, I thought it was caused by my too high version of eclipse, so I specially installed the low version of eclipse framework. The installation steps are as follows:

In eclipse, follow these steps:

help -> To install new software, enter the following address in the work with input box:

http://download.eclipse.org/eclipse/updates/4.5

Select as shown in the figure below, and then install next

After the installation is completed, an error is still reported when you re install fatjar, which proves that it is not the above problem. Later, I installed version 4.7 back and it still works

2. P2 problem

Later, I saw the following explanation on the Internet:

The reason for the error is an error in eclipse’s update management P2. P2 has a garbage collection mechanism. If the previously deleted jar package is reloaded before it is recycled, the system will not download it again, but it can’t find the jar package, so it reports an error

To solve this problem, you need to enter the following command on the command line:

eclipse -application org.eclipse.equinox.p2.garbagecollector.application -profile ****

****Is the value of eclipse.p2.profile in eclipse/configuration/concfig.ini

As shown in the figure below, it is the place to find this value:

I tried this command under the command line of wind, but it didn’t work

Because this command starts with eclipse, if you enter it, you will be prompted that you are not a built-in command. It is said on the Internet that you can add eclipse environment variables to environment variables, but I don’t know how to add eclipse environment variables

Later, I saw that the CMD command could be used in eclipse on the Internet, so I got this method as follows:

In eclipse, do the following:

Run-> External Tools-> External Tools Configurations

The following interface appears

Select new in the red box, fill in the information as shown in the figure, click Run, and then input the command in the console window. According to my situation, I input the following command, and do not copy the parameters:

eclipse -application org.eclipse.equinox.p2.garbagecollector.application -profile epp.package.jee

The following figure is the operation interface:

Then restart eclipse, install again, install successfully, restart OK

IV. using fatjar

1. Application mode

After my test, it seems that the fatjar plug-in can only be used in Java mode. As shown in the figure below, several modes are installed in my eclipse

2. Use steps

step one

Among these modes, only Java mode can right-click to see the following operation options:

Click the red box option above to enter the fatjar operation interface

Step 2

The following figure shows the important configuration interface of fatjar packaging

The figure below is divided into three areas, according to their own practice, respectively, if there are errors, please remind me to correct them in time:

This page is generally checked according to the current configuration

the first block

Jar Name: the path where the jar package is stored plus the name of the jar package

Use external jar Name: if not checked, the jar package can only be stored in a certain location in the workspace, and the name can be customized. As shown in the figure below:

After checking, the jar package can be stored in any directory, as shown in the following figure:

the second block

This is better than eclipse, you can choose to use the three-party dependency jar package to package together or just package the code

After selecting manifest file, you can use the manifest.mf file you edited. The manifest input box corresponds to the path of the selected file

Select manifest file is not checked. You need to enter the value of main class: which is the main class to run. Class path does not need to be selected. The following two items are checked automatically. At this time, the dependency package will be packaged with the code you wrote, and can be run directly with Java commands

the third block

If it is checked, the final jar package will contain two jar packages. You can’t see your relevant information. You can try it to know its effect

Step 3

After configuring the previous page, click next to enter the next configuration page, as shown in the following figure:

This page is to select the code you want to package, according to their own needs to choose

​​​​​​​

After selection, click fish

When eclipse uses Maven: index downloads are disabled, search results may be incomplete

Why can’t you stop buying 618?From the technical dimension to explore>>>

when eclipse uses Maven: index downloads are disabled, search results may be incomplete

Reference article:

(1) When eclipse uses Maven: index downloads are disabled, search results may be incomplete

(2) https://www.cnblogs.com/EasonJim/p/6674099.html

Let’s make a note.

[Solved] Eclipse project red exclamation mark: build path problem

Eclipse red exclamation mark: Build Path Problem

Description Resource Path Location Type
A cycle was detected in the build path of project ‘shgl-category-api’. The cycle consists of projects {shgl-category-api, shgl-category-provider} shgl-category-api Build path Build Path Problem

The project has a red exclamation mark There are several possible causes.

First, convert eclipse to Markers view, windows —->show view —->markers, check the specific error message.

1, project right click properties java build path click library tab change jre system library to your local jre or jdk

2, multiple project project cycle reference, resulting in, “A cycle was detected in the build path of project: XXX”

The solution is very simple.
Eclipse Menu -> Window -> Preferences… -> Java -> Compiler -> Building -> Building path problems -> Circular dependencies -> Change Error to Warning

3, the project cannot be built until its prerequisite problem. Solution.

Close the project. Then open, project-> clean can be