jar

Accessing resources inside a JAR [duplicate]

时间秒杀一切 提交于 2019-12-25 04:53:24
问题 This question already has answers here : How do I read a resource file from a Java jar file? (9 answers) Closed 2 years ago . I'm making a test program for resource loading inside a jar and I'm having problems. I've read that you should use ClassLoader or alternatively getClass() to access a file inside a jar. Since the method that i use to load the resource is static, I use ClassLoader.getSystemResource(String path) . My program finds the file but says that the path contains invalid syntax

How to create .exe from jar files in java? [duplicate]

故事扮演 提交于 2019-12-25 04:28:36
问题 This question already has answers here : How can I convert a JAR file to an EXE file? (8 answers) Closed 4 years ago . We created jar file of our project. Jar file name is stock.jar ,in dist folder: lib folder,one stock.jar , stock.sqlite . Now we want to create .exe with database and lib folder jars. 回答1: Here are the List of option you have launch4j Excelsior JET JSmooth JarToExe Advanced Installer launcher and installer for Java applications - TUTORIAL JexePack Executable Wrapper Jwrapper

Picture inside .jar file wont work when I export it

馋奶兔 提交于 2019-12-25 04:27:51
问题 Picture inside .jar file wont work when I export it. I made a Java program that displays a picture, and it works perfectly in Eclipse, but when I export it to a .jar file, it wont display the picture. I just started learning Java, and I have no experience with creating Jar files and using files from inside the jar file. Heres my code: import javax.swing.*; class displayPicture{ public static void main(String args[]){ JFrame frame = new JFrame(); ImageIcon icon = new ImageIcon("src/img.gif");

Picture inside .jar file wont work when I export it

喜夏-厌秋 提交于 2019-12-25 04:27:10
问题 Picture inside .jar file wont work when I export it. I made a Java program that displays a picture, and it works perfectly in Eclipse, but when I export it to a .jar file, it wont display the picture. I just started learning Java, and I have no experience with creating Jar files and using files from inside the jar file. Heres my code: import javax.swing.*; class displayPicture{ public static void main(String args[]){ JFrame frame = new JFrame(); ImageIcon icon = new ImageIcon("src/img.gif");

How to use autowiring and package as a jar

a 夏天 提交于 2019-12-25 04:16:09
问题 I am trying to build a core-services jar, where I am making use of @Component, @Service and @Autowired annotations to autowire beans. I am packaging as a simple jar. How do I use the beans of this jar to autowire in another spring-boot application which uses core-services jar as a pom dependency? 回答1: Once you add them as your pom dependencies, you can configure them so that they will get court to your @ComponentScan So in your Final application @SpringBootApplication @ComponentScan

Android: Eclipse : Project could not build due to cannot delete v-7appcompat

匆匆过客 提交于 2019-12-25 04:07:42
问题 I have created an Android application API 21 using Eclipse luna. I have only API 21 installed on my pc. Initially I faced error of "could not find resource......" for which I found that I got to add support library v7-appcompat. Tried various ways to add the jar, nothing worked. So finally I added the appcompat project to my project. That solved that error. Then on re-start Eclipse got new 3 errors - Unable to load API 19... (something like this) in appcompat project. In appcompat project int

.jar files created with maven do not open

可紊 提交于 2019-12-25 03:44:37
问题 I just faced problem I can not get rid off, like in title, when I build .jar from maven project using netbeans it just do not open outside of IDE. Using run button in IDE runs application perfectly and without problems, but builded .jar's just do not open. Other .jar's from other projects works normally, it is first time I am building something with maven so I think the problem is there. This is my pom file, hope the problem is somewhere here: <?xml version="1.0" encoding="UTF-8"?> <project

How to find the location of a bash file?

血红的双手。 提交于 2019-12-25 02:45:17
问题 I've made an executable jar file for a terminal game I've been working on. So far, I opened it by typing java -jar name.jar in the Terminal. This worked, but when I made a .sh file with the same command, the jar file couldn't be accessed. (situation [1]) Later, I realised that if I specify where the jar file is, it does open. (situation [2]) But the jar file and bash file are in the same folder called "playgame", and if I were to move that folder elsewhere, that file path specified in the

Problems in running jar on Amazon ec2 [duplicate]

£可爱£侵袭症+ 提交于 2019-12-25 02:44:14
问题 This question already has answers here : How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version (48 answers) Closed 6 years ago . Hi I have a java project in eclipse. The main class as follows: package aws; public class Assignment3 { public static void main(String[] args) throws Exception { } } My manifest file is: Manifest-Version: 1.0 Class-Path: aws.Assignment3 I exported my executable jar with scp to my ec2 successfully. When I try to run my jar I get: [ec2

Adding Attribute to JAR's Manifest Via ANT TASK

落爺英雄遲暮 提交于 2019-12-25 02:39:10
问题 all i am stuck with an issue. I have 14 third party jars.I am signing those jars with comodo code sign certificate successfully via ant task. Now i want to accomplish that whenever i sign those jars i need to add some attributes to jar's manifest file , How can i do that ? I found some manifest task inside jar task but did not find anything while signing. all those jars are third party jars and already packed so i think do not need to compile and pack them from the source. Thanks 回答1: You'd