jar

Difference between maven scope compile and provided for JAR packaging

你。 提交于 2019-12-27 09:02:11
问题 What is the difference between the maven scope compile and provided when artifact is built as a JAR? If it was WAR, I'd understand - the artifact would be included or not in WEB-INF/lib. But in case of a JAR it doesn't matter - dependencies aren't included. They have to be on classpath when their scope is compile or provided . I know that provided dependencies aren't transitive - but is it only one difference? 回答1: From the Maven Doc: compile This is the default scope, used if none is

Difference between maven scope compile and provided for JAR packaging

被刻印的时光 ゝ 提交于 2019-12-27 09:01:12
问题 What is the difference between the maven scope compile and provided when artifact is built as a JAR? If it was WAR, I'd understand - the artifact would be included or not in WEB-INF/lib. But in case of a JAR it doesn't matter - dependencies aren't included. They have to be on classpath when their scope is compile or provided . I know that provided dependencies aren't transitive - but is it only one difference? 回答1: From the Maven Doc: compile This is the default scope, used if none is

Running a jar file on other Windows versions

一世执手 提交于 2019-12-26 03:54:26
问题 I've written a code that is supposed to be exporting a set of windows registry keys. I've successfully written the code and was able to also send the results of executing the code as a jar file to my email. However, while testing the jar file ( I've included the piece of code in the build.xml from the java website that will allow me to run the jar file out of the dist folder) I was able to get the desired results on my machine because I wrote the code on a windows 8.1 machine. While testing

Add JAR to WAR's classpath without changing the WAR file

痞子三分冷 提交于 2019-12-25 18:41:24
问题 I deploy a WAR file in Tomcat. In addition I have a JAR file. Is it possible to make the classes in the JAR file available to services in the WAR file without changing the WAR file, or does it have be added to the WAR's WEB-INF/lib? I've tried adding the JAR to lib/ , but it doesn't work. Spring fails with org.springframework.beans.factory.BeanCreationException » java.lang.NoClassDefFoundError upon startup. EDIT I realized that I might have made myself an unsolvable and architectually ugly

Maven assembly jar: JCE cannot authenticate the provider BC

走远了吗. 提交于 2019-12-25 18:02:18
问题 I'm developing an app that takes a XML file, sends it to a server, and receives some data in response. I need to package it into an .exe(legacy reasons), and for that I need a jar. I intend to use assembly plugin to package the app into a jar with all the dependencies. The app works fine when run from the IDE with mvn clean package exec:java -Dexec.mainClass="cz.tomasdvorak.eetdemo.Main" -Dexec.args="C:\\eetTesting\\testtrzba.xml" but as soon as I build the standalone .jar with mvn clean

Java JAR - Exception in thread “main” java.lang.NoClassDefFoundError

我怕爱的太早我们不能终老 提交于 2019-12-25 17:19:12
问题 Im working on Ubuntu . I made simple GUI app which uses 3 classes. Main is Test.class which contains main method. I have packed them all into JAR from console level. Now I have "kalkulator.jar" which contains: Test.class, MyFrame.class, MyPanel.class and META-INF folder. In META_INf there is MANIFEST.MF. What is in MANIFEST.MF is: "Main-Class: Test" and newline character. Now I try to open my JAR from console using: java -jar kalkulator.jar I get: "Exception in thread "main" java.lang

Java JAR - Exception in thread “main” java.lang.NoClassDefFoundError

喜你入骨 提交于 2019-12-25 17:18:56
问题 Im working on Ubuntu . I made simple GUI app which uses 3 classes. Main is Test.class which contains main method. I have packed them all into JAR from console level. Now I have "kalkulator.jar" which contains: Test.class, MyFrame.class, MyPanel.class and META-INF folder. In META_INf there is MANIFEST.MF. What is in MANIFEST.MF is: "Main-Class: Test" and newline character. Now I try to open my JAR from console using: java -jar kalkulator.jar I get: "Exception in thread "main" java.lang

Accessing classes in an external Jar

半城伤御伤魂 提交于 2019-12-25 16:59:11
问题 I am having problems having my Java programs see classes that are packaged in an external jar. I am running under Windows 7. I have the classes embedded in a jar called ParserUtilities.jar. I established the path with a CLASSPATH variable using the System utility and the Environment tab. I confirmed that the CLASSPATH is set correctly. When I type echo %CLASSPATH%, I see C:\Program Files\Java\externaljars\ParserUtilities.jar which is correct. But when I type java -jar Parse.jar (my executable

Spring boot, runnable jar can't load package-info.class

▼魔方 西西 提交于 2019-12-25 16:57:55
问题 We use Spring boot with hibernate database mapping. The entities contains JSON columns mapped as a customized types defined using package-info.java file. When we run the spring-project from Eclipse IDE everything is ok and we can call our web services. When we generate an executable jar and we try to call our web services the following error is raised : mai 04, 2017 1:35:00 PM org.apache.catalina.core.StandardWrapperValve invoke GRAVE: Servlet.service() for servlet [dispatcherServlet] in

How to get an image or js from a JAR in the server in JSF (For a custom component)

做~自己de王妃 提交于 2019-12-25 15:56:10
问题 I have done a custom JSF component (it looks like a combobox (icefaces selectonemenu)) but it uses a couple of images (png) and a bit of javascript. I jar everything, so then the developers use it as a jar copied in the web-inf/lib folder. The image and the js are just for this custom component, so I can't make them put this image and js in his project, it has to be in MY jar. I jar everything and it works almost great, just the image and the JS, I do not get them to work. I do not know how