jar

Serialized files don't work when project is converted to executable jar?

你说的曾经没有我的故事 提交于 2019-12-30 07:22:45
问题 I made my java project into an executable jar using the export to jar option in eclipse. The jar runs as expected, except that it does not use any of the serialized files. I can see that clearly from the GUI. What could be the reason for this problem and how do I fix it ? I saw this related question - Why does my JAR file not create a serialization? But it does not tell me exactly how to get around this problem. It looks like you cannot pack a folder into a jar. Why ? Because code could

How to make an executable jar file using IntelliJ from a Selenium/TestNG java file?

本秂侑毒 提交于 2019-12-30 06:05:30
问题 I've been Googling for days trying to figure out how to do this, if anybody has done this before I would greatly appreciate the help. I have an automation test project I've created in IntelliJ that automates a user interacting with a Web Application. I'd like to put that automated test (created in Java, using Selenium and TestNG) into an executable jar file that others can run by double-clicking the jar file. Every time I attempt to create a jar file by navigating to Project Structure ->

Are both the JRE and the JDK required to run a JAR file?

懵懂的女人 提交于 2019-12-30 03:57:08
问题 It is possible to run a JAR file locally. The next step is to run it on a different PC. The question is whether the JRE, the JDK or both are required to run the JAR file? 回答1: The JDK contains the JRE. Most program only need the JRE (Java Runtime Environment) but some programs need the Compiler at runtime in which case you need the JDK. If you have the JDK, you don't need the JRE as well. 回答2: To run a jar file you only need java.exe(windows). JDK is the development kit for Java and JRE is

Executing a jar file in Linux [closed]

自作多情 提交于 2019-12-30 03:34:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . I have created an executable Java .jar file. That is to say, I properly packaged a java program inside a .jar file, including a META-INF/MANIFEST file. (Incidentally, on most Windows machines with Java installed, .jar files are registered to run as something like javaw.exe -jar %1 , so you can just double click

How do I get a Java resource as a File?

隐身守侯 提交于 2019-12-30 03:21:06
问题 I have to read a file containing a list of strings. I'm trying to follow the advice in this post. Both solutions require using FileUtils.readLines , but use a String , not a File as the parameter. Set<String> lines = new HashSet<String>(FileUtils.readLines("foo.txt")); I need a File . This post would be my question, except the OP was dissuaded from using files entirely. I need a file if I want to use the Apache method, which is the my preferred solution to my initial problem. My file is small

Hadoop HADOOP_CLASSPATH issues

倖福魔咒の 提交于 2019-12-30 02:25:29
问题 This question doesn't refer to distributing jars in the whole cluster for the workers to use them. It refers to specifying a number of additional libraries on the client machine. To be more specific: I'm trying to run the following command in order to retrieve the contents of a SequenceFile: /path/to/hadoop/script fs -text /path/in/HDFS/to/my/file It throws me this error: text: java.io.IOException: WritableName can't load class: util.io.DoubleArrayWritable I have a writable class called

Autoupdate feature in a Java Swing desktop App

筅森魡賤 提交于 2019-12-30 02:19:09
问题 I've developed a desktop Swing app and I'm thinking about the best way to provide the autoupdate feature. I know that JavaWebStart provides this but I think that It doesn't suit my needs because I need to read local files so I would need to sign the jar. Besides, JWS requires extra work to deploy in the server while now I only need to upload the .jar. I've been thinking about this approach: A first JAR (which never needs updating) loads the splashscreen, checks the current version in a config

Why is there no spring-asm-3.2.4.RELEASE jar?

自闭症网瘾萝莉.ら 提交于 2019-12-30 01:37:33
问题 I'm trying to build a complete Spring Framework distribution for version 3.2.4.RELEASE without using maven (just the spring jars) and managed to manually get all jars except for spring-asm. Spring-asm stops at version 3.1.4. Why is that? I have older spring distributions up to 3.1.1 (those for which you had a zip file, not forced to use maven) and all have the same spring-asm jar inside, with the same version. Why is there no spring-asm-3.2.4.RELEASE jar? 回答1: Here is from release notes for 3

How to call java from C++

旧城冷巷雨未停 提交于 2019-12-29 09:11:34
问题 I need to run this line from my c++ program: java -jar test.jar text1 text2 the java app will give a float value and give it to the c++ program. How can I do this? I never call a java stuff before from my ms visual studio C++ file. 回答1: When I run the java command directly on my command prompt, it works. but when I run the command from the c++ file, the error says "The system cannot execute the specified program" . here's my code, im using ms visual studio 2005 : #include "stdafx.h" #include

Read a file within a jar from java code present in same jar

人走茶凉 提交于 2019-12-29 09:11:06
问题 I am trying to read a xsd file kept in a jar using java code kept inside the same jar. I am using the following code. URL tmpurl = ClassLoader.getSystemResource("com/abc/filename.xsd"); Schema s = schemaFactory.newSchema(tmpurl); jaxbUnMarshaller.setSchema(s); It is working fine when I run it as a separate project but when I make a jar, tmpurl is null, hence the setSchema gives a null pointer exception. Can you please a workaround that can make it run even inside a jar file. 回答1: Hava you