executable-jar

Java- export to jar- i/o problems

两盒软妹~` 提交于 2019-12-19 12:33:42
问题 I work on Eclipse (Juno with JDK7), and the program runs (on Eclipse) fine. My problematic lines are: URL imageURL = new URL("http://www.idautomation.com/ocr-a-and-ocr-b-fonts/new_sizes_ocr.png"); RenderedImage img = ImageIO.read(imageURL); File outputfile = new File("saved.png"); ImageIO.write(img, "png", outputfile); But when i export the project to a jar file and try to run it via windows (7- 64 bit) command line, the following error appears: Exception in thread "main" java.lang.reflect

Java- export to jar- i/o problems

落爺英雄遲暮 提交于 2019-12-19 12:33:41
问题 I work on Eclipse (Juno with JDK7), and the program runs (on Eclipse) fine. My problematic lines are: URL imageURL = new URL("http://www.idautomation.com/ocr-a-and-ocr-b-fonts/new_sizes_ocr.png"); RenderedImage img = ImageIO.read(imageURL); File outputfile = new File("saved.png"); ImageIO.write(img, "png", outputfile); But when i export the project to a jar file and try to run it via windows (7- 64 bit) command line, the following error appears: Exception in thread "main" java.lang.reflect

how to make runnable jar for javaCV or openCV project from Eclipse

耗尽温柔 提交于 2019-12-19 10:56:09
问题 I have a openCV project in eclipse. Now I am trying to make it runnable Jar but not able to launch it , once trying to run the jar. I tried following - https://groups.google.com/forum/#!topic/javacv/ziqKIb7PgYk but I couldn't understand properly. Can anyone explain the proper way to do the needful. in my System , OpenCV is installed. Once I try to run the project from eclipse , everything works fine . but when I try to do the same from runnabelJar it doesn't. The problem I found it that I

Executable Jar cannot find typesafe/config application.conf on classpath

那年仲夏 提交于 2019-12-19 09:43:07
问题 I have a command line app that downloads some reports, processes them, then uploads data to Google Drive. I'm using Typesafe-Config for all the magic strings I need. Typesafe-Config looks on the classpath for my application.conf file and uses HOCON to map config objects to fields in my class, like this: From ~/configs/application.conf : my.homePageUrl = "https://my.home.com" From MyClass.java : private static Config config = ConfigFactory.load(); private static final String HOME_URL = config

Eclipse cannot create runnable jar - No resources selected

ε祈祈猫儿з 提交于 2019-12-18 12:06:18
问题 When I try to export my project as a runnable jar Eclise gives me the following error: No resources selected. The project runs fine within Eclipse, I already tried to clean the project before exporting, but that didn´t work. Any ideas on how to fix this. 回答1: The problem is most likely with your run configuration. Go to your Class that contains the main(String[] args) method you wish to automatically run when the jar is called from the command line Right-click->Run As...->Application Make

java eclipse create executable jar

馋奶兔 提交于 2019-12-18 08:56:18
问题 I used eclipse to create executable jar. It relies external other jars. In Eclipse, It is simple that you just need to choose Extract required libraries into generated JAR . You can create an executable jar. It can be executed any places where jre is installed. But If I use command line to compile jar. javac -classpath [external jars] *.java jar cfm [a name].jar manifest *.class [external jars] It can generate jar. But the jar can only be executed in the directory where it is produced. If I

Runnable jar with jvm args

孤人 提交于 2019-12-18 05:55:39
问题 I was trying to create a runnable jar file using Eclipse. The problem is that the vm parameters I have added to the run configuration in the Eclipse were not saved in any way. I know I can create a batch file that will run the jar with the needed arguments, but I would prefer my users will just run the jar itself. My question is therefore, is there any way to pass vm arguments to the runnable jar not by command line? 回答1: Briefly, you can't do this without some form of wrapper. You can write

Can I use the classpath to override a file in a jar that is being run?

只愿长相守 提交于 2019-12-18 05:34:28
问题 I have a JAR file that contains an application as well as configuration files for that application. The application loads configuration files from the classpath (using ClassLoader.getResource() ), and has its dependencies completely satisfied using the configuration files baked into the JAR file. On occasion I want the application to be run with a slightly different configuration (specifically I want to override the JDBC URL to point to a different database) so I create a new configuration

How do I create an executable fat jar with Gradle with implementation dependencies

白昼怎懂夜的黑 提交于 2019-12-17 23:16:36
问题 I've got a simple project in Gradle 4.6 and would like to make an executable jar of it. I've tried shadow , gradle-fatjar-plugin , gradle-one-jar , spring-boot-gradle-plugin plugins but neither of them adds my dependencies declared as implementation (I don't have any compile ones). It works with compile e.g. for gradle-one-jar plugin but I would like to have implementation dependencies. Thank you very much! 回答1: You can use the following code. jar { manifest { attributes( 'Main-Class': 'com

Build Java entire project jar using JDeveloper

我只是一个虾纸丫 提交于 2019-12-17 21:20:14
问题 I am using JDeveloper 11g to develop a desktop application. I want to make entire project jar which is run-able in java environment.. if I use only standard Java library jar works fine but my project contains external library like JfreeChart, Comm, Hibernate3 etc etc... when I try to make jar Its shows errors how can I make entire jar of my projects along with external library's. thank you 回答1: Please follow the below instructions.. Right-click project and select properties. Click on