Many people do not know how to generate jar files in eclipse, or they will always receive
Exception in thread "Main" Java. Lang. noclassdeffounderror :******
This error message.
In fact, generating jar files in eclipse is very simple:
1. Right-click the project to generate the jar and select export from the menu)
2. Select JAR file for the export type.
3. Select or enter the generated path
4. The manifest file is generated by default. You can also save the generated file to the specified path.
ProgramClick "Browse". eclipse will automatically detect the classes that can be cut in. Just select the class you want to use as the starting point.
(The following is an example of my own program. The manifest file is automatically generated and saved to the triangle folder of the workspace. The file name is manifest and the entry point is clstriangle)
(Generated JAR file)
5. Run the JAR file and enter:
Java-jar E:/mytriangle. Jar
Run successfully,
Many of my friends generate the JAR file and execute it with simple input.
Java jar_file_path
In this case, the JAR file cannot be executed. You only need to add the parameter-jar.