executable-jar

Launching a Java program via double click [closed]

三世轮回 提交于 2019-12-11 13:57:53
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I have a Java program that I have been working on. I would like to show it to my girlfriend, who would have no clue as to how to work with Java, and make

Java JAR behaving differently to program run out of IDE

[亡魂溺海] 提交于 2019-12-11 13:13:26
问题 Ok, so I have been making a chat client in netbeans and I'm pretty much done. I decided to clean and build to test it standalone. However, when a message is received from the other program using sockets (Connection goes fine), the program closes. This issue never occurred when it was run straight from the IDE. So, what I am wondering is whether the program behaves differently(well it obviously does, but how?) once it is clean and built into a jar. Is there something extra I must take into

Running a jar file having multiple main classes using command line

孤街浪徒 提交于 2019-12-11 12:07:54
问题 Have added multiple main classes in jar using following code in pom.xml as follows <groupId>com.test</groupId> <artifactId>indexer</artifactId> <version>1.0.0-SNAPSHOT</version> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.4.1</version> <executions> <execution> <phase>package</phase> <id>build-first</id> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade

Exporting a JAR with Ressources

二次信任 提交于 2019-12-11 11:28:41
问题 I was trying to solve this problem the whole day but in vain !! Basically I want to export a JAR with images and a txt file (and latter maybe an audio file). I found that I need to make a new folder within I should add my resources, I did. then I found that I should use something like : pan.add(new JLabel(new ImageIcon(getClass().getResource("/131868.jpg")))); instead of pan.add(new JLabel(new ImageIcon("/131868.jpg"))); I did but for my text file BufferedReader br = new BufferedReader(new

How to encode data of XSLT stylesheet

久未见 提交于 2019-12-11 10:57:29
问题 I have generated an XSLT stylesheet which converts an XML file to an ePub . I use saxon9.jar to convert the XML using XSLT . Now I need to know whether I can make the XSLT code binary. Is it possible using java , so that I can generate a jar file which converts the XML to ePub using saxon , provided that the content of XSLT file is not readable. 回答1: The problem got resolved after I read this page: http://saxon.sourceforge.net/saxon7.6/using-xsl.html#Compiling 回答2: One possibility would be to

File association using my executable jar file

只愿长相守 提交于 2019-12-11 06:32:32
问题 I have assigned an extension name for my files called *.XSCA. I would like to read the content of this file when the user click on it using my executable jar file to open it. How can I do that? 回答1: assuming you work under windows: create a batch-file (*.bat) that calls your jar (it should just be something like "java -jar yourJar.jar") click right on a file of your type, go to "Properties" and change the program that opens your file to that batch-file let the batch-file pass the file

JFreeChart Java JAR not running on a different machine

ⅰ亾dé卋堺 提交于 2019-12-11 06:03:49
问题 I have created an application using the JFreeChart library for use on another machine. Previously I have developed applications with JFreeChart (using the same libraries) which has worked fine on other machines. The only difference is this machine is running Vista. Please see below for the run-time exception I am getting: The class that cannot be found, however, is located in the highlighted jar in the below image showing my imported libraries for the JAR. I have also established that this

Trying to get a properties file from a jar file in another jar file

守給你的承諾、 提交于 2019-12-11 03:05:57
问题 I have an executable jar file (A.jar), built with Eclipse, that relies on other jar files (B.jar) that are included in the jar file, and accessed via the jarinjarloader. While this works to access the java code inside those jar files, when that code calls InputStream inStream = <Class>.getClassLoader().getResourceAsStream(propFile); it fails to find the properties file contained in B.jar. The code works when run in Eclipse, so I know the correct properties files are there. I tried extracting

Java error using JARs, java.lang.NoClassDefFoundError: javax/mail/Store

*爱你&永不变心* 提交于 2019-12-11 02:55:22
问题 I'm making a java application that uses Javamail, and it works great when I compile it. I want to make it into a jar file so it can be easily moved around and executed. The problem is I am getting this error when I try to run the jar from the cmd line java -jar ActriveTray2.jar Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Store at stockApp.init(stockApp.java:11) at ActiveTray.main(ActiveTray.java:31) Caused by: java.lang.ClassNotFoundException: javax.mail.Store at

How to distribute Java-based software?

做~自己de王妃 提交于 2019-12-11 02:23:09
问题 Now, don't get me wrong, I am a very competent programmer, but when I program, I typically develop things for the web using scripting languages like JavaScript, PHP, Python, SQL, etc. If I want to develop Java software (I am relatively experienced in Java), how do I distribute it? Is there any good way to package up Java software in a nice little executable, send it out, and have it run? Alternatively, is there any good way to package up Java in some sort of installer, and send it out to be