jar

What is System.out exactly?

徘徊边缘 提交于 2021-02-04 17:53:05
问题 I noticed that any call to System.out.println() from a JAR file that hasn't been started by the command line (i.e. a Runnable JAR file started by user with double-click) won't open the console. After doing some research, I found multiple answers on the site: System.out.println in jar There is no problem doing like that. But where do you expect to see the output? What happens to “System.out.println()” in executable jar? If you run the code in some way that doesn't attach a console - such as

Get a JAR File version number

两盒软妹~` 提交于 2021-02-04 13:59:19
问题 I have an application used in clustering to keep it available if one or more failed and I want to implement a way to check the version of the jar file in java. I have this piece of code to do that (e.g.: in the class MyClass) : URLClassLoader cl = (URLClassLoader) (new MyClass ()) .getClass().getClassLoader(); URL url = cl.findResource("META-INF/MANIFEST.MF"); Manifest manifest = new Manifest(url.openStream()); attributes = manifest.getMainAttributes(); String version = attributes.getValue(

Error: “Caused by: java.lang.ClassNotFoundException: org.eclipse.paho.client.mqttv3.MqttCallback” when doing java -jar myproyect.jar

心已入冬 提交于 2021-01-29 20:43:04
问题 I got that error when I tried to run my proyect using java -jar. My proyect is a MQTT server that has a controller class: public class ControladorMQTT and a callback class: public class CallbackMQTT implements MqttCallback and it seems that the callback clas is not beeing detected. This is the complete error: C:\Users\Moreno\Documents\IntelliJ\ControladorMQTT\out\artifacts\ControladorMQTT_jar>java -jar ControladorMQTT.jar Error: A JNI error has occurred, please check your installation and try

Classpath jar files in eclipse

为君一笑 提交于 2021-01-29 18:01:14
问题 I am new to eclipse and I have a general question about referencing external Jar files. I went to the buildpath -> configure build path and added my two jar files that I wanted to reference as parts of an external library but I can seem to make an instance object of the classes in that jar. And also I tried just copy and pasting the jar files to the extension folder of the standard library too but this also doesn't work. How can I use the instance objects of the classes included in these jar

Images in jar file [duplicate]

一世执手 提交于 2021-01-29 10:50:37
问题 This question already has answers here : Java Path ImageIcon URL .JAR (1 answer) Runnable JARs missing Images/Files (Resources) (5 answers) Closed 7 years ago . I made a java application and bundled all classes in jar file.When I run the project from eclipse my app is running successfully,but it is not fetching the images from the desired directory.Please let me know how can we present these image files to the end user (like we present .jar file) 回答1: Probably you need to implement your own

Can a Java Applet Access Local File System

﹥>﹥吖頭↗ 提交于 2021-01-29 10:40:31
问题 I am creating a java applet, that gets information out of a JAR file on my local file system, and creates a jpanel to display in the applet. I am getting the applet to load correctly on the appletViewer in Eclipse, but it will not load whenever i launch the Html file i created. The html file is points to the class files, also to the external jars. Any Suggestions? Thanks 回答1: Yes, if the applet is signed with the jarsigner tool. 回答2: Unless explicitly granted, an applet may not access the

how can i handle with /tmp/jar_cache#######.tmp?

▼魔方 西西 提交于 2021-01-29 09:31:03
问题 I am using springboot 2.1.4 with EmbeddedTomcat. When i run my server, /tmp/jar_cache###.tmp is created. How can i handle with jar_cache###.tmp? I am using CENTOS 7 and java version "1.8.0_162". If i change tmpdir to other directory, not /tmp, then how can i handle with a lot of jar_cache### that is created by default? Using /tmp directory, What if jar_cache was cleared that was using in my application? java 46030 www DEL REG 253,2 2830 /tmp/jar_cache7122103988160656171.tmp java 46030 www DEL

How to make jar file with all dependencies a.k.a. Fat jar with IntelliJ

て烟熏妆下的殇ゞ 提交于 2021-01-29 08:49:30
问题 I'm trying to make jar file with all dependencies in my project. I'm using IntelliJ. I tried two ways. In maven window of upper-right part of IntelliJ, I clicked "clean" and "package" with below pom.xml. But it doesn't contain any dependencies. I'm using IntelliJ in window, so I can't follow below link which is CLI. I'm using GUI maven window in upper right part of IntelliJ. How can I create an executable JAR with dependencies using Maven? I clicked Build-Build artifact - build following

IntelliJ runnable jar doesn`t work on other computers

南笙酒味 提交于 2021-01-29 08:29:15
问题 In IntelliJ I created a simple program(Im a beginner) and Im trying to create a runnable JAR file so I can run the program on a different computer. But when I tried it on a different computer, It gave me this error, Im not sure if its something wrong on the computer or the runnable JAR:"A JNI error has occured. Please check your installation and try again". However It works perfectly if I run the program on my computer. I created runnable JAR using this guide: https://www.jetbrains.com/help

Project works in eclipse but not after being packaged in a jar

守給你的承諾、 提交于 2021-01-29 07:20:14
问题 My project uses itext7 to create PDF files. When I launch from eclipse everything works perfectly. When I package it as a jar, everything works until I get to the point that I want to create a PDF. I then get: Exception in thread "JavaFX Application Thread" com.itextpdf.io.IOException: I/O exception. ..... Caused by: java.io.FileNotFoundException: C:\Users\puser\eclipse-workspace\Document\target\SE001-0.1.1-SNAPSHOT.jar\img\Safety.png (The system cannot find the path specified) The project