executable-jar

Apache POI in executable jar

﹥>﹥吖頭↗ 提交于 2019-12-13 03:24:23
问题 My program successfully runs the Apache POI functionality to read Excel Files. It works fine when I run it with java class name. When I package as an executable jar it does not work. Here is the error message I keep getting: java -jar some.jar Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class

javax/inject/Inject.class in lib/javax.inject-1.jar is hidden by lib/javax.inject-2.5.0-b42.jar on onejar executable

老子叫甜甜 提交于 2019-12-13 02:37:00
问题 I am attempting to create an atomic executable jar (i.e. no dependencies outside of the jar). To do this I have added a com.jolira:onejar-maven-plugin in my pom.xml. This seems to do the job, but when I execute the jar I get the warnings: JarClassLoader: Warning: Null manifest from input stream associated with: lib/javax.inject-1.jar JarClassLoader: Warning: javax/inject/Inject.class in lib/javax.inject-1.jar is hidden by lib/javax.inject-2.5.0-b42.jar (with different bytecode) JarClassLoader

IntelliJ artifact JAR file: Could not find or load main class

淺唱寂寞╮ 提交于 2019-12-12 12:36:02
问题 I created a JAR artifact in IntelliJ with option to extract JAR files to the target JAR. Look like this: I filled the manifest information properly: I checked the content of the JAR file with ZIP and it contains the jar files, the properly filled MANIFEST.MF and the .class files for my project. But if I try to run it, it drops an error: d:\Own_Tools\REF_Standalone\build>java -jar REF_Standalone.jar Error: Could not find or load main class com.continental.ref.REFController I am pretty sure it

How to create an executable jar file which can be distributed or packaged?

假如想象 提交于 2019-12-12 12:19:35
问题 I am using getdown to create a means to update a java application. When I have completed this tutorial, I tested if it works on command line as below: % java -jar c:/downloads/getdown-X.Y.jar c:/netBeans/getdown/src Thankfully, this works and launches the application. Great. How do I make a jar file and distribute this? I tried to make a jar file on this project but it didn't work, this project does not run. When I run this getdown-X.Y.jar on command line. I think it still using the same file

Open an HTML File Inside a .JAR File

混江龙づ霸主 提交于 2019-12-12 12:06:12
问题 I have an html file called snake.html that I would like to put inside a jar. When the jar is run the main class should open this html file in the browser. I have tried: public static void main(String[] args) throws IOException, URISyntaxException { URL url = Snake.class.getResource("/WebContent/snake.html"); System.out.println(url); // relative to the class location Desktop.getDesktop().browse(url.toURI()); } Which works if I just run this code but when I jar it (and the html file) I get the

Exporting A Libgdx Game as Executable Jar from Android Studio

一曲冷凌霜 提交于 2019-12-12 08:31:15
问题 Okay so I made a game using Libgdx and I intended it to be a android app(which is why i use android studio) but I want to let my friend without android phones try it out. The project is already setup for both desktop and android so is there any way to export this as a executable jar file? 回答1: Type the command below in the terminal. Remember that you have to be in your LibGDX root directory, before issuing this command. gradlew desktop:dist More at: https://github.com/libgdx/libgdx/wiki

Runnable jar file generated by Eclipse wont execute?

巧了我就是萌 提交于 2019-12-12 07:06:54
问题 I generated a very simple runnable jar file using Eclipse's "Export-->Java-->Runnable Jar File" function. My HelloWorld class looks like this: import javax.swing.JFrame; public class HWorld extends JFrame { public static void main(String[] args) { new HWorld(); } public HWorld() { this.setSize(200, 100); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setTitle("Hello World!"); this.setVisible(true); } } Now, after generating the .jar file , it runs fine from the command line using

making a jar file

一世执手 提交于 2019-12-12 05:29:36
问题 I have written a code for client/server application. and I go to properties>packaging for making a jar file for it. but when I run my server side and then client side ! it doesn't make the jar file for my application! what should I do? please help me thanks 回答1: Use this to make an executable jar jar cf jar-file input-file(s) or alternatively you can write ant script to do the same Document 回答2: If you are a real beginner I suggest that you follow the Java Tutorials Especially the one on Jar

Java Eclipse executable jar file

守給你的承諾、 提交于 2019-12-12 04:35:33
问题 I am new to eclipse + Java. I am trying to create executable jar file with eclipse export option. It works very well. But in my project, I have almost 10 packages (my own) and 4 main classes. I want to create a executable jar file that can execute any of main class from 4 main classes. For example: Double click write class name and run that class 回答1: Just a quick example of how to deal with command line options to launch different things, I would have put it into a reply to @serplat's answer

Include spring xml in jar by maven-assembly-plugin packaging

天大地大妈咪最大 提交于 2019-12-12 03:56:47
问题 I am trying to create an executable jar with all of its dependency along with the spring's configuration xml file. Here is the definition of the maven-assembly-plugin in the pom.xml: <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>service.coucou.Main</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <descriptors> <descriptor>assembly.xml</descriptor> </descriptors>