Tag Archives: IDEA

ideaUnable to ping server at localhost:1099

I checked it online   Many problems are caused by Tomcat and JDK versions   Then when looking at the Tomcat version   That is, run version.bat under the bin folder of Tomcat   Error reporting the JRE_HOME environment variable is not defined correctly

It’s hard   Check the problem again   Added JRE_The home environment variable is still not easy to use  

Then I saw an article saying that there is a setclasspath.bat directly under the bin folder of Tomcat  

Java can be directly set here_Home and JRE_HOME

Because I thought it was the wrong environment variable

Open it and find that Java is set in it_Home and JRE_Commands for home

Then JRE_Home is my previous JRE address  

I remember changing JRE’s address a few days ago     There is no change here

Then everything will be all right

IDEA uses sonarlint error [How to Solve]

The following errors may occur when using sonarlint in idea:

 

 1 Plugin 'org.sonarlint.idea' failed to initialize and will be disabled.  Please restart IntelliJ IDEA.
 2 com.intellij.diagnostic.PluginException: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 52.0 [Plugin: org.sonarlint.idea]
 3     at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:130)
 4     at com.intellij.ide.plugins.cl.PluginClassLoader.a(PluginClassLoader.java:77)
 5     at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
 6     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 7     at java.lang.Class.forName0(Native Method)
 8     at java.lang.Class.forName(Class.java:249)
 9     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:427)
10     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:417)
11     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.access$000(ComponentManagerImpl.java:403)
12     at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:108)
13     at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87)
14     at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101)
15     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:499)
16     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:481)
17     at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:170)
18     at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:62)
19     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
20     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
21     at java.awt.EventQueue.access$400(EventQueue.java:82)
22     at java.awt.EventQueue$2.run(EventQueue.java:676)
23     at java.awt.EventQueue$2.run(EventQueue.java:674)
24     at java.security.AccessController.doPrivileged(Native Method)
25     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
26     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
27     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
28     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
29     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
30     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
31     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
32     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
33     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
34 Caused by: java.lang.UnsupportedClassVersionError: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 52.0
35     at java.lang.ClassLoader.defineClass1(Native Method)
36     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
37     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
38     at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
39     at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:259)
40     at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:255)
41     at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:231)
42     at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:124)
43     ... 30 more

 

Reason:

The jdk boot version used by idea is too low, need to upgrade jdk boot

How to check the idea jdk version:

IntelijIdea->abount IntelijIdea to see it.

My solution:

Just install the new version of idea, the default jdk version is 1.8.*. sonrlint works fine.

Solution to the invalidity of adding. Gitignore to the. Idea directory of IntelliJ idea

The reason is: the corresponding directory or file has been submitted before , and has been tracked by git, so adding. Gitignore is invalid

The following solution is only applicable to this situation, you need to go to the server to verify

Solutions

git rm -rf .idea; 
git commit -m "delete .idea"; 
git push;

If you are prompted that the file has been modified, you can cache it, or directly – f force delete it:

 git rm --cached DayTest.iml;
 git rm -f DayTest.iml;

Confirm to delete the warehouse file

Add more ignore

Solution to the error “can’t use subversion command line client: SVN” in idea

1. Problem presentation:

The project uses SVN as version control. The following error occurred when starting idea after importing the project–

2. Problem analysis:

1) From the error message, idea can’t use the command line of the local SVN client, so the root of the problem lies in the local installation of tortoise SVN

2) The command line client option is not selected when installing TortoiseSVN locally

3. Solutions:

1) Find the installation package that installed tortiosesvn at that time, double-click it,
2) and then select (modify) to modify the installation.
3) after that, you will see a message in front of command line client tools ×
4) click red ×, Select enter feature will be installed on local hard drive
5) and then click next to install
note: after the installation, make sure that the environment variable path contains “C: program files/TortoiseSVN/bin”. If it does, it will be a great success, only one last step away to enter the subversion of setting and find your local svn.exe, apply

[Solved] IDEA JDK is 1.8 Warning: Diamond types are not supported at this language level

help——about View the version of ide.

IntelliJ IDEA 2017.3.7 (Ultimate Edition)
Build #IU-173.4710.11, built on April 4, 2019
Licensed to Rover12421/Rover12421
You have a perpetual fallback license for this version
Subscription is active until December 31, 2099
JRE: 1.8.0_152-release-1024-b18 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1

A newly created maven project, created by clicking next, resulted in the following error when newKafkaProducer<>.

Diamond types are not supported at this language level

You can see that Diamond is a feature of JDK1.7, so 1.5 is definitely not supported.

Right click on the project and select Open Module Setting

Open the following pop-up window, the error is that the default Language level here is still 5.0

The jdbc driver imported from idea into MySQL appears “Java. Lang. classnotfoundexception: com. Mysql. CJ. JDBC. Driver”

 

When we use java to operate MySQL database in idea, the following results will appear:

Exception in thread “main” java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader. java:382 )
at java.lang.ClassLoader.loadClass(ClassLoader. java:418 )
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher. java:355 )
at java.lang.ClassLoader.loadClass(ClassLoader. java:351 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class. java:264 )
at src.mySql.Jdbc.main(Jdbc. java:10 )

1、 General solution

1. JDBC download link

https://dev.mysql.com/downloads/connector/j/

2. Select the content to download and download it

Select platform independent as the operating system. For the two records in the list below, the suffix tar.gz is the Linux version and the suffix. Zip is the Windows version

Here, download the jdbc driver of Windows version, version 8.0.18

Skip login and click the content in the red box to download

3. Import driver into Java project

In idea, click file — project structure

Module, dependencies tab

Click the plus sign (+) on the far right and select jars or directions

2、 Still import driver failed

1. In idea, click file — project structure

2. Select the SDKs, click the plus sign (+) on the far right, select the jdbc driver of Windows version we downloaded before, and then click OK to confirm

3. Finally, we can use this driver by connecting to MySQL database on the idea

Example:

package src.mySql;

import java.sql.*;

public class Jdbc {
    public static void main(String[] args) throws Exception {
        Connection conn = null;
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            long start = System.currentTimeMillis();

            conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb1",
                    "root", "root");
            long end = System.currentTimeMillis();
            System.out.println(conn);
            System.out.println("Time to establish connection: " + (end - start) + "ms milliseconds");

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (conn != null) {
                    conn.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

    }
}

Results: the results were as follows

Idea write JUnit test case found:…empty test suite

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

When learning mybatis from the video, I used JUnit to write a test case to test Dao method, and reported the following error:

After reading some posts on the Internet, some said to delete the root directory. Idea file, and some said to clear the run/debug configuration, but it was not solved. I remembered that I had reported an error before:

This means that the output path is unknown. It was set to./out at that time. Just read a post saying that class not found is not that the class cannot be found, but that the compiled. Class file cannot be found, so the output path is set to out under the project, and the problem is solved

The setting method is as follows:

1. Press Ctrl + Shift + Alt + s to find Modules > The path is as follows:

2. Select project and set the output folder according to your own needs

An error occurred when the idea was compiled: java.io.ioexception: cannot create empty file:

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

A few days ago, after the computer was updated, this problem appeared when I opened the idea. At that time, I thought I had changed the configuration file of idea

Problem solving:

1. Problems after updating the computer: (you may not update it, but you have changed the coding format of the computer)

A) open the control panel to find the clock and area

        

    

B) find the area

      

C) management > Change system locale

      

D) cancel the bate version of Unicode – UTF-8 (if it has been cancelled, you can also check it)

      

2. Code format configuration in idea: (if problem 1 is not solved)

      a) File > Settings…

        

      b) Editor > File encodings to configure tuf-8 character encoding

Step 4, transparent native… Can be checked or not. It is only used for serialization

        

          

How to Solve IDEA Start Error: a jni error has occurred

A JNI error has occurred, please check your installation and try again

Solution:

1. JDK configuration problem, Java configuration_ Home, configure path, configure classpat

JAVA_ HOME=C:\Program Files (x86)\Java\jdk1.7.0

path=%MAVEN_ HOME%\bin;% JAVA_ HOME%\bin

classPath=.;% JAVA_ HOME%\lib\dt.jar;% JAVA_ HOME%\lib\tools.jar;

2. The problem of compilation level is as follows: to match with JDK, it is better to choose 1.5 compilation level for 1.7 JDK

Failed to create webapp project with Maven in idea (without SRC and other file directory): received fatal Alert: Protocol_ Version solution

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

Specific steps:

1. First, add a configuration to Maven Runtime: – dhttps. Protocols = tlsv1.2, as shown in the following figure

2. Create project or module

3. When selecting a webapp template, use the Maven below instead of the coco above

3. The rest is the normal flow of things, not to repeat

Created web project structure:


explain why :

Due to the insecurity of tlsv1.1 protocol and the PCI security standard, maven sonatype central warehouse no longer supports tlsv1.1 and the following protocol versions from June 18, 2018

For the original text, please refer to the official explanation of no longer supports tlsv1.1 and below

The JDK I use is 1.7. Although jdk1.7 supports TLS 1.2, it is disabled by default, so the received fatal Alert: protocol above will appear_ Version exception

The following table shows the default TLS protocol used by JDK in different versions of Oracle documents:

solutions:

scheme 1: upgrade JDK to 1.8

JDK1.8 TLS 1.2 is enabled by default, and this exception will not occur

PS: the price can be a bit high, especially for some old projects, which can not be upgraded just by upgrading

scheme 2: enable TLS 1.2 by adding – dhttps. Protocols = tlsv1.2 and configuring the Java runtime parameter

summary: if you are JDK 1.7, both schemes are OK (this article uses the second scheme). If you are 1.6 or below, it is recommended to upgrade JDK