当前位置:网站首页>NoClassDefFoundError and classnotfoundexception exceptions
NoClassDefFoundError and classnotfoundexception exceptions
2022-06-24 05:45:00 【FHAdmin】
1. brief introduction ClassNotFoundException and NoClassDefFoundError When JVM Unable to find classpath The requested class occurred .
2.ClassNotFoundException ClassNotFoundException It's a checked exception , An exception that occurs when an application attempts to load a class with its fully qualified name and cannot find it on the classpath . Mainly occurs when trying to use Class.forName()、ClassLoader.loadClass()、ClassLoader.findSystemClass() When loading a class . for example : Load a class that doesn't exist
Class.forName("acb.s.sad")3.NoClassDefFoundError Happen when NoClassDefFoundError ( java fhadmin.cn), The system does not work properly , And it can't be recovered . When JVM Try the following :
Use new Instantiate a class Use method calls to load classes When the compiler can successfully compile classes , but java The runtime cannot find the class file , Errors will occur . It usually occurs when an exception occurs when executing a static block or initializing a static field of a class , So class initialization failed 4. Solution The main reason is that the runtime class file ( Class path ) Unavailable . resolvent :
Ensure that the class containing the class or... Can be used in the classpath jar. without , You need to add it manually . If available on the classpath , Then it is possible that the path is covered . At this time, you need to find the exact path of the class . 5. summary ClassNotFoundException and NoClassDefFoundError It's all because of java The runtime could not find the class related . ClassNotFoundException yes java Exception thrown when loading class at runtime (Exception), And the name is provided at run time . NoClassDefFoundError Is that this class exists at compile time , but java The runtime cannot find... On the path .
边栏推荐
- Net is what domain name? What is the standard of a good domain name?
- Explain thoroughly and learn thoroughly binary tree (6): written test of binary tree: flip | width | depth
- 2021, how to select a programming language?
- How to register domain name and web address? What is the domain name and URL?
- Edgegallery: MEC open source platform extends 5g capability to the edge
- How to check the domain name of the website? Are there any skills to speak of
- How to register a domain name how to select a domain name registrar
- The website cannot be opened after windows installs the dongle
- Analysis and summary of the packet capturing artifact tcpdump - covering major use scenarios and advanced usage
- What does it mean that the terminal displays escape character is'^]'after the telnet peer port?
猜你喜欢
Learning routes and materials for cloud native O & M engineers

Answer questions! This article explains the automated testing framework in software testing from beginning to end
Easy to understand JDBC tutorial - absolutely suitable for zero Foundation

How should we learn cloud native in 2022?
What cloud native knowledge should programmers master?
随机推荐
Tencent security operation center integrates ueba capabilities to help enterprises ensure internal network security
How do users in the insurance upgrade industry choose?
What happened to the JVM locking on Tencent ECS?
How do websites apply for domain names? How to select a website domain name?
Experience sharing on unified management and construction of virtual machine
How to get the website domain name? Does it cost money to apply for a website domain name?
How about the XYZ domain name? What are the advantages over other domain names?
How to buy a network domain name? Is the domain expensive
Tomorrow, we will help farmers make their debut together!
What is a top-level domain name? What are the classifications of a top-level domain name
Why storage?
Oceanus practice consumption CMQ subject model data source
What kind of intelligent connection design do we need in an interconnected society?
How do users check the domain name registrar? What are the conditions for domain name registration?
Technical dry goods | multi modal classification and recognition of audio-visual scenes in the stage of Tencent cloud smart media AI
Mysql database backup under Windows Environment
What is a domain name address? What is the reason for using a domain name address?
How about the work domain name? Does the work domain name need real name authentication?
His secret script of hard technology investment
How about the online domain name? Is it easy to use from the current market