executable-jar

Runnable JAR not working with referenced libraries

回眸只為那壹抹淺笑 提交于 2019-12-07 06:35:09
问题 I want to create a runnable JAR that include referenced libraries, namely jackson, in eclipse via the export. There used to be fat jar that seemed to be the goto solution before Eclipse offered to export to runnable JAR. From this question, the first option would be what I'm looking for. Since it is for the moment a small project, it wouldn't be a problem to always have everything together (plus it's easier for me since I'm just starting with JARs, runnables and jnlp) When I try to launch it,

Convert JarEntry to File

佐手、 提交于 2019-12-06 13:44:38
I'm using a library which wants a File() as an argument. The file I want to pass it is one I want to package with my app, as part of the .jar Is there any way to convert the JarEntry that I get from within my .jar to a File object I can pass? If not and I have to copy the resource to disk temporarily, where's the best place to put the temporary file? Thanks. You cannot get a path to a file within a JARFile, only a stream, so you should extract it to the temporary directory and then pass that extracted file. Here's a function I wrote to do this when I provided a db with a jar previously. /** *

org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe'' finished with non-zero exit value 3

放肆的年华 提交于 2019-12-06 12:06:58
问题 i import one project in my Android studio so my build.gradle file as follows. build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "pkg.demo" minSdkVersion 15 targetSdkVersion 22 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile 'com.android.support

Creating Runnable JAR from Eclipse IDE

笑着哭i 提交于 2019-12-06 11:25:28
I look over a lot of info on the web also look at some of the questions here, but couldn't solve my problem so I post this question. I have fairly simple project using SWING which compiles and run under Eclipse, but when I try to use the standard Export->Java->Runnable Jar leaving the default properties at the end I have a file which when I dobule-click I get this: Could not find the main class: TableFilterDemo. Program will exit . Here is my project structure: And this is the configuration I use for creating the Runnable Jar : And because as far as I understand the error there is some problem

How to read external xml file from jar

瘦欲@ 提交于 2019-12-06 08:22:28
问题 i need to read an external XML file from my java application in jar executable file. If I lunch it from console (java -jar package.jar) it works fine, but if I lunch it by double click (Java Platform SE binary) it don't work. I have this problem with relative path. With absolute path it work in both way. 回答1: You need to add the (JAR-relative) path to the XML tile to the Class-Path entry in the MANIFEST.MF file. This entry contains information about the JAR's runtime classpath. Assuming that

Eclipse plugin with external third party jar

不想你离开。 提交于 2019-12-06 06:11:05
I have an RCP application which includes different plugins. In one of the plugin I am using an external third party jar. Due to copyrights reasons I cannot bundle that jar into my product. So I try to include the jar as external jar at runtime. what I have done is as follows In the Plugin manifest.mf I have Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: EaCom-plugin;singleton:=true Bundle-Version: 2.1.0 Require-Bundle: org.eclipse.core.runtime Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ClassPath: ., external:$eaapi_location$/eaapi.jar

how to create a runnable jar file from command line similar to eclipse

北慕城南 提交于 2019-12-06 04:31:05
问题 I understood that eclipse generates a runnable jar file with all library .jar files extracted and included in the jar file. How do I do the similar this while creating a jar file manually from command prompt. Do I need to extract all the lib jars into classes folder? Currently I am using - jar cvfm example.jar manifest.txt -C Classes/ . Which creates a jar file with all the class files and I need to have all the library jars in the same folder as this example.jar exists. 回答1: there's no way

Bundling JAR dependencies with executable JAR (Über JAR) from command line

戏子无情 提交于 2019-12-06 03:52:35
问题 I'm trying to create an executable jar from the command line. The main class in the JAR has dependencies that i have packaged into another plain JAR file. I want to package the dependency JAR together with the executable JAR in order to have a single JAR file to ship. What i have tried so far is the following: The dependency Hello.class file has the mock code: public class Hello { public String getHello() { return "Well hello there!!"; } } I have packaged class file into hello.jar using: jar

Exported runnable JAR file from Eclipse doesn't seem to execute

你说的曾经没有我的故事 提交于 2019-12-06 03:48:19
问题 (Disclaimer: I am not a Java programmer, and really have very little idea what I'm doing in Eclipse) I hacked out an application in Eclipse a while back which I finished off and exported as a JAR which runs nicely. I didn't take any notes or make any comments. The time comes to make some changes to the project but I have to reload it all again because my PC has since been wiped so some settings etc have probably changed. Anyway it all works and runs nicely from Eclipse. But when I export as a

How to make ImageIO read from InputStream :Java

半城伤御伤魂 提交于 2019-12-06 01:18:04
问题 I have created executable jar file(using Eclipse) , there are a set of image (.png) files that is to be inculded in the jar. So I have added a source folder with all the images inside /images folder in the project . Code has to access these file to create BufferedImage using ImageIO.read(new File(path); Earlier, To get the path I used ClassName.class.getResource(/image/test.png).toURI(); On executing jar , it throw error URI is not hierarchical So now I am using ClassName.class