executable-jar

Getting File permissions error when exploding the cucumber-jvm.jar

余生长醉 提交于 2019-12-13 17:33:19
问题 I am trying to create an executable jar for functional tests by exploding the dependency jars, using gradle task of type Jar. Cucumber-1.1.3 is one of the dependencies. I am using gradle 1.1 with JVM 1.6 (company standards) I get the following error : org.gradle.api.GradleException: Could not expand ZIP '/dev/shm/263985/transformer/caches/artifacts-14/filestore/info.cukes/cucumber-java/1.1.3/jar/4b389fbe494942b319518d27ae38571f477967f6/cucumber-java-1.1.3.jar'. at org.gradle.api.internal.file

run a executable jar file within java program using class loaders

无人久伴 提交于 2019-12-13 15:22:18
问题 I have heard that you could run other java files using Process or using ClassLoaders. I have a executable jar 'test.jar' with a main class called Test . I found a way to run using Process. I need to know how to do it using ClassLoaders. Process p = Runtime.getRuntime().exec("java -jar test.jar"); BufferedInputStream bis = new BufferedInputStream(p.getInputStream()); synchronized (p) { p.waitFor(); } int b=0; while((b=bis.read()) >0){ System.out.print((char)b); } 回答1: The basic approach is to:

Using task scheduler for running java jar (from batch file)

拜拜、爱过 提交于 2019-12-13 15:05:09
问题 I am scheduling a task (with windows task scheduler) which simply run a batch file. this batch is running a jar file (Java program) with a simple "Java -jar test.jar". When i run the script from the command line manually, the java program runs well and no exception is shown. but when the task schedular does the same (calling the command), the java program ends with an exception: "ClassNotFoundException" for one of the classes which is in my jar. What way be the cause of this? what is the

org.apache.http jar class not found in android studio projects

蓝咒 提交于 2019-12-13 09:06:53
问题 i include following jars see below image. I want to integrate json web service so i import below jars apache-mim44j-0.-6.jar gson-2.1.jar httpmime-4.0.1.jar json_simple-1.1.jar build.gradle file apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '22.0.1' defaultConfig { applicationId "pkg.android.myapp" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(

Opening HTML files in SWT browser from .jar with hyperlinks working

落爺英雄遲暮 提交于 2019-12-13 07:45:17
问题 I have a set of help files for my SWT application that I have open in-application using the Browser control. Navigation through the help files is done through hyperlinks of relative pathnames (i.e: <a href="aboutUs.htm"> , so only one html file is actually opened by java code, helpHome.htm. I am opening this using String homeURL = this.getClass().getResource("/help/helpHome.htm").toString(); and browser.setURL(homeURL); This works beautifully when I'm just debugging it in Eclipse.

How to create a executable jar file using Maven and Netbeans

眉间皱痕 提交于 2019-12-13 07:02:16
问题 I'm trying to create a runnable jar file, but somehow my Maven/Netbeans fails to do so. This is my pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>de.ksw</groupId> <artifactId>KBSE-CDI-Testprogram</artifactId> <version>1.0</version> <packaging>jar<

creating an executable jar file with ant which includes the build.xml file

对着背影说爱祢 提交于 2019-12-13 06:32:42
问题 I am trying to use ant to build an application, run the application's main() method, run junit tests, and package everything in a jar file (source+build+libraries+build.xml). The classes include a runner class with a main() method entry point. The objective however is to inlcude all libraries used, like junit.jar, and the ant build.xml itself. I was wondering if there is a way for the executable jar file, to run selected targets of the ant build file itslef, instead of just the main() method.

Exporting project with libraries to runnable jar from Eclipse

时间秒杀一切 提交于 2019-12-13 04:24:20
问题 I was trying to export a test of a game I am working on(that uses the Slick library), to send to my partners who lack any IDE, all went well with the export in eclipse, but when I try to run it from command prompt, this is what I get in return. C:\Users\Noah\Desktop>java -jar test.jar Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect

How could I execute a jar from another program and display the results in another?

寵の児 提交于 2019-12-13 03:58:32
问题 I have 2 java programs. One is an executable jar that will return a value of hello world to a console. Listed below.. public class MainClass { public static void main(String[] args) { helloWorldSubRoutine(); } public static void helloWorldSubRoutine () { String helloWorld = "Hello there!"; System.out.println(helloWorld); } } The other program is a simple jframe with a label that I want it to display a return or string from another jar. What is the easiest way to do this? 回答1: You know what's

how to fix invalid or corrupt Jarfile?

只谈情不闲聊 提交于 2019-12-13 03:57:17
问题 I am working on a simple java project 'Hello world!'. So after creating my code I built it and created the Jarfile using maven: mvn clean install package So my problem is when ever I try to run the executable Jarfile I get the following error message: Error: Invalid or corrupt jarfile junit-1.2.jar this is my pom.xml file <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven