Snippets tagged “jar”
14 snippets use this tag.
- Can't execute jar- file: "no main manifest attribute"Java
The "no main manifest attribute" error is usually caused by a missing or incorrect Main-Class attribute in the manifest file of a Java .jar file.
- Eclipse error: "The import XXX cannot be resolved"Java
If you get the error "The import XXX cannot be resolved" in Eclipse, it means that the class or package that you are trying to import cannot be found in the classpath of your project.
- Extract source code from .jar fileJava
To extract the source code from a .jar file, you can use a decompiler such as JD-GUI or Cavaj Java Decompiler.
- How to add local .jar file dependency to build.gradle file?Java
To add a local JAR file dependency to a build.gradle file, you can use the compile fileTree() method and specify the directory where the JAR file is located.
- How to build JARs from IntelliJ properly?Java
To build a JAR (Java Archive) file from IntelliJ IDEA, you need to follow these steps:
- How to decompile a whole Jar file?Java
To decompile a JAR file, you can use a Java decompiler such as JD-GUI.
- How to get the path of a running JAR file?Java
To get the path of a running JAR file, you can use the java.lang.Class class's getProtectionDomain method and then the getCodeSource method.
- How to import a jar in Eclipse?Java
To import a JAR file into Eclipse, follow these steps:
- How to open/run .jar file (double-click not working)?Java
To open a .jar file on a Windows system, you can do one of the following:
- How to run a JAR fileJava
To run a JAR file, you need to have Java installed on your computer. If you don't have it installed, you can download it from the Oracle website.
- Including dependencies in a jar with MavenJava
To include dependencies in a JAR file with Maven, you can use the maven-assembly-plugin to create an assembly that includes all the dependencies of your project.
- Running JAR file on WindowsJava
To run a JAR file on Windows, you will need to have the Java Runtime Environment (JRE) installed on your system. You can then run the JAR file by double-clicking it or by using the java command in the command prompt.
- Viewing contents of a .jar fileJava
To view the contents of a .jar file, you can use the jar command-line utility that is included with the Java Development Kit (JDK).
- Why am I getting a NoClassDefFoundError in Java?Java
A NoClassDefFoundError in Java indicates that the Java Virtual Machine (JVM) or a ClassLoader was not able to find the definition of a class that was referenced in your code. This can occur for a variety of reasons, including: