jar

The system cannot find the path specified in JAR

末鹿安然 提交于 2021-02-11 14:24:50
问题 I'm trying to play an audio file. In my IDE (intellij) that works completely fine, but when running in a JAR, I get the error java.io.FileNotFoundException: D:\soni801\Documents\Redsea Productions\The Great X Wars\alpha-0.0.7.1.jar\audio\click.au (The system cannot find the path specified) The file's location inside the JAR is audio/click.au , and the JAR is located at D:\soni801\Documents\Redsea Productions\The Great X Wars\alpha-0.0.7.1.jar which afaik should make the absolute path D:

How should a file: URI corresponding to a Windows path name look like?

被刻印的时光 ゝ 提交于 2021-02-11 07:01:47
问题 I am trying to load a MySQL jar dynamically in code but I am unsure about the format of the Windows path name. Is what I am using below correct, for loading a .jar from a thumbdrive? URL u = new URL("jar:file:G:/mysql-connector-java-5.1.15.jar!/"); URLClassLoader ucl = new URLClassLoader(new URL[] { u }); Now, this is not the same as the traditional path that you see in Java tutorials: URL url = new URL("file:/g:/mysql-connector-java-5.1.15.jar"); For the answer, I am looking for

Run an executable JAR with external class path

对着背影说爱祢 提交于 2021-02-10 20:51:40
问题 Using Maven I compiled my project into a JAR that includes all the dependencies except for one big dependecy. The inclusion of the dependecies is done using: <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <configuration> <archive> <manifest> <mainClass>com.mypackage.Main</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id>

Run an executable JAR with external class path

非 Y 不嫁゛ 提交于 2021-02-10 20:50:49
问题 Using Maven I compiled my project into a JAR that includes all the dependencies except for one big dependecy. The inclusion of the dependecies is done using: <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <configuration> <archive> <manifest> <mainClass>com.mypackage.Main</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id>

Main-Class is not written to manifest of a jar

…衆ロ難τιáo~ 提交于 2021-02-10 17:59:29
问题 when I create a jar file from .class files with either: jar cmvf META-INF/MANIFEST.MF MyApp.jar *.class or jar cmvf manifest.mf MyApp.jar *.class despite a line with main class in the manifest file: Manifest-Version: 1.0 Created-By: 1.8.0_171 (Oracle Corporation) Main-Class: MainClassName I get an error when I start MyApp.jar java -jar MyApp.jar no main manifest attribute, in MyApp.jar when i unpack the jar (in some other folder) with: jar xf MyApp.jar the manifest looks like this: Manifest

Main-Class is not written to manifest of a jar

让人想犯罪 __ 提交于 2021-02-10 17:57:47
问题 when I create a jar file from .class files with either: jar cmvf META-INF/MANIFEST.MF MyApp.jar *.class or jar cmvf manifest.mf MyApp.jar *.class despite a line with main class in the manifest file: Manifest-Version: 1.0 Created-By: 1.8.0_171 (Oracle Corporation) Main-Class: MainClassName I get an error when I start MyApp.jar java -jar MyApp.jar no main manifest attribute, in MyApp.jar when i unpack the jar (in some other folder) with: jar xf MyApp.jar the manifest looks like this: Manifest

NoClassDefFoundError in a provider jar when using a class from org.keycloak.authentication.authenticators.broker.util

我们两清 提交于 2021-02-10 15:56:00
问题 I am writing an Authenticator provider for keycloak, that I package as a .jar . As soon as it uses a class from keycloak-services, I get a NoClassDefFoundError . I get the same error when the provider is deployed via " mvn wildfly:deploy ". I must be missing something, but I rarely do java code and I am clueless at this point. I defined the dependencies in pom.xml, and tried both 'provided' and 'compile' as scope: <dependencies> <dependency> <groupId>org.keycloak</groupId> <artifactId

Failed to find Premain-Class manifest attribute from a jar file

∥☆過路亽.° 提交于 2021-02-10 14:11:50
问题 I created a jar from a single .class and I mentioned in the manifest the Premain-class, the jar was generated as expected but when I try to run a program that uses the class from that jar , I get an error MANIFEST.MD Premain-Class : Agent Agent.java import java.lang.instrument.Instrumentation; public class Agent{ private static Instrumentation inst; public static void premain(String paramString, Instrumentation paramInstrumentation) { inst = paramInstrumentation; } public static long size

Failed to find Premain-Class manifest attribute from a jar file

余生长醉 提交于 2021-02-10 14:11:43
问题 I created a jar from a single .class and I mentioned in the manifest the Premain-class, the jar was generated as expected but when I try to run a program that uses the class from that jar , I get an error MANIFEST.MD Premain-Class : Agent Agent.java import java.lang.instrument.Instrumentation; public class Agent{ private static Instrumentation inst; public static void premain(String paramString, Instrumentation paramInstrumentation) { inst = paramInstrumentation; } public static long size

Failed to find Premain-Class manifest attribute from a jar file

痴心易碎 提交于 2021-02-10 14:08:06
问题 I created a jar from a single .class and I mentioned in the manifest the Premain-class, the jar was generated as expected but when I try to run a program that uses the class from that jar , I get an error MANIFEST.MD Premain-Class : Agent Agent.java import java.lang.instrument.Instrumentation; public class Agent{ private static Instrumentation inst; public static void premain(String paramString, Instrumentation paramInstrumentation) { inst = paramInstrumentation; } public static long size