Eclipse – JAR creation failed “Class files on classpath not found or not accessible for…”
Just do a clean and/or rebuild on the project. You can find it under the Project menu of Eclipse.
Just do a clean and/or rebuild on the project. You can find it under the Project menu of Eclipse.
Module: A new language feature introduced in Java 9 (similar to class, interface, package, etc.) that consists of a collection of packages, similar to how a package consists of a collection of types. JAR: An archive file format that bundles code and resources and which can be loaded by the JVM. More specifically, a module … Read more
you can use the command prompt: javaw.exe -jar yourfile.jar Hope it works for you.
Have you tried using the zipfileset task? <jar destfile=”stripped.jar”> <zipfileset src=”full.jar” excludes=”files/to/exclude/**/*.file” /> </jar> Example <property name=”library.dir” value=”dist” /> <property name=”library.file” value=”YourJavaArchive.jar” /> <property name=”library.path” value=”${library.dir}/${library.file}” /> <property name=”library.path.new” value=”${library.dir}/new-${library.file}” /> <target name=”purge-superfluous”> <echo>Removing superfluous files from Java archive.</echo> <jar destfile=”${library.path.new}”> <zipfileset src=”${library.path}” excludes=”**/ComicSans.ttf” /> </jar> <delete file=”${library.path}” /> <move file=”${library.path.new}” tofile=”${library.path}” /> </target>
File -> Export -> Export JAR File. Then select your project, press next twice, select the main class. If you just want to run, open the main class and click the green arrow at the top. If you just want to build class files, I believe that Eclipse automatically builds every time you save. You … Read more
Adapt this example: How to extract Java resources from JAR and zip archive Or try this code: Extract the Contents of ZIP/JAR Files Programmatically Suppose jarFile is the jar/zip file to be extracted. destDir is the path where it will be extracted: java.util.jar.JarFile jar = new java.util.jar.JarFile(jarFile); java.util.Enumeration enumEntries = jar.entries(); while (enumEntries.hasMoreElements()) { java.util.jar.JarEntry … Read more
In case of a JSP/Servlet webapplication, you just need to drop 3rd party JAR files in /WEB-INF/lib folder. If the project is a Dynamic Web Project, then Eclipse will automatically take care about setting the buildpath right as well. You do not need to fiddle with Eclipse buildpath. Don’t forget to undo it all.
You need a Service Wrapper to run the Jar file. There are examples and instructions for init.d here. or for systemd (ubuntu 16+) here
I’ve just run into the same problem. I haven’t tried it yet, but I plan to include versions of swt.jar for all platforms and load the correct one dynamically in the start of the main method. UPDATE: It worked. build.xml includes all jars: <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_linux_gtk_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_macosx_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_win32_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_linux_gtk_x64.jar”/> … Read more
You don’t need to install them manually. Maven will do this for you when executing: mvn clean install You need a configuration along the lines of: … <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build> … Then, later on in your other module where you’ll need to … Read more