jar

Java won't recognize file in JAR

橙三吉。 提交于 2021-02-20 04:55:27
问题 I have a .csv database file inside my java program's JAR file. The program works fine in NetBeans IDE before I package it, but once I do, it refuses to believe the file is in it, even though I had it print out the path where it was looking and unzipped the JAR to be sure I told it to look in the right place. How do I make Java see this? try { String path = Main.class.getResource("/items.csv").getPath(); db = new java.io.File(path); loadValues(db); } catch (java.io.FileNotFoundException ex1) {

Maven project does not referenced sikuli-api dependency in java

大兔子大兔子 提交于 2021-02-19 07:11:23
问题 I created Maven Project and I have an error, I think dependencies does not work. pom.xml file does not read properly. pom.xml file has red x icon on it. I edited the error is: Missing artifact com.sikulix:sikulixapi:jar:1.1.0 and 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.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion>

Maven project does not referenced sikuli-api dependency in java

ぃ、小莉子 提交于 2021-02-19 07:10:07
问题 I created Maven Project and I have an error, I think dependencies does not work. pom.xml file does not read properly. pom.xml file has red x icon on it. I edited the error is: Missing artifact com.sikulix:sikulixapi:jar:1.1.0 and 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.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion>

Maven project does not referenced sikuli-api dependency in java

好久不见. 提交于 2021-02-19 07:09:20
问题 I created Maven Project and I have an error, I think dependencies does not work. pom.xml file does not read properly. pom.xml file has red x icon on it. I edited the error is: Missing artifact com.sikulix:sikulixapi:jar:1.1.0 and 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.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion>

JAR files created by IntelliJ IDEA do not run

半腔热情 提交于 2021-02-19 03:18:47
问题 I wrote a program that spans a few classes in IntelliJ and it works fine when I was testing it in the IDE. However, whenever I follow tutorials to make my project into a .jar executable, it does not run. The file in the out folder does not run when double-click on it and says "The Java JAR file "projectName.jar" could not be launched. When opening it from the terminal, I get the error "Could not find or load main class". I used "$ java -jar projectName.jar " I followed these steps: Open

JAR files created by IntelliJ IDEA do not run

点点圈 提交于 2021-02-19 03:16:19
问题 I wrote a program that spans a few classes in IntelliJ and it works fine when I was testing it in the IDE. However, whenever I follow tutorials to make my project into a .jar executable, it does not run. The file in the out folder does not run when double-click on it and says "The Java JAR file "projectName.jar" could not be launched. When opening it from the terminal, I get the error "Could not find or load main class". I used "$ java -jar projectName.jar " I followed these steps: Open

How to create a fat jar?

风流意气都作罢 提交于 2021-02-18 07:57:50
问题 With SpringBoot, you have the @SpringBootApplication annotation, but what is the equivalent with the neat Java Spark framework? IntelliJ creates a Maven project and I added the spark dependency, but running the install goal, I get a 5 KB jar with no manifest. Not an executable jar. The pom.xml created thus far is as follows: <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:/

Customize dependency file names in maven

蹲街弑〆低调 提交于 2021-02-17 06:22:06
问题 I'm using maven-dependency-plugin to copy dependency jars into specific folder. I'm looking the way to customize copied jar file names using dependency properties: groupid, artifactid and version. example: I have following dependency <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.3.2</version> </dependency> I'd like to copy dependency jar as "org.apache.commons.commons-lang3-3.3.2.jar" How can I accomplish this? 回答1: I was able to achieve

Why dependencies do not accompany the made package by Maven?

六眼飞鱼酱① 提交于 2021-02-17 06:09:21
问题 I've followed the simplest maven example and made the following 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.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>my-app</name> <url>http://maven.apache.org</url>

Why dependencies do not accompany the made package by Maven?

血红的双手。 提交于 2021-02-17 06:09:19
问题 I've followed the simplest maven example and made the following 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.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>my-app</name> <url>http://maven.apache.org</url>