Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31128

Re: Executable JAR files and writing to a text file.

From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Executable JAR files and writing to a text file.
Date 2015-02-12 19:22 -0500
Organization A noiseless patient Spider
Message-ID <mbjgbg$omf$1@dont-email.me> (permalink)
References <5efb672e-7a66-4db0-af62-42fc48cd59f6@googlegroups.com>

Show all headers | View raw


On 02/12/2015 12:40 PM, Doug Mika wrote:
> I have an application in which it writes to a text file at
> a specific directory location.
> I run the program and it runs fine! Now I create an executable JAR file.
> Should the jar file work fine if the program needs to write to a
> text file in ../resources/HighScore.txt?

It seems to me that you are hoping to access a text file that is
external to your jar, and that this external text file is located
in a directory relative to your jar. If this is correct, then
there seems to be some gotchas involved and I'm not familiar
enough with the api to offer concrete advice. But there is some
discussion on stackoverflow that might help.
<http://stackoverflow.com/questions/8775303/read-properties-file-outside-jar-file>
Is one such discussion. Probably more, you might try searching there.



Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Executable JAR files and writing to a text file. Doug Mika <dougmmika@gmail.com> - 2015-02-12 09:40 -0800
  Re: Executable JAR files and writing to a text file. Jeff Higgins <jeff@invalid.invalid> - 2015-02-12 19:22 -0500
  Re: Executable JAR files and writing to a text file. Nigel Wade <nmw@ion.le.ac.uk> - 2015-02-13 10:01 +0000
  Re: Executable JAR files and writing to a text file. Arne Vajhøj <arne@vajhoej.dk> - 2015-02-14 22:31 -0500

csiph-web