Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: Executable JAR files and writing to a text file. Date: Thu, 12 Feb 2015 19:22:34 -0500 Organization: A noiseless patient Spider Lines: 19 Message-ID: References: <5efb672e-7a66-4db0-af62-42fc48cd59f6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 13 Feb 2015 00:26:24 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="c50a9e5d554cfaba13eda1c71e805135"; logging-data="25295"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qGNb/ht+AcqsH1OBFH2rfTAqsxN+5bMs=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: <5efb672e-7a66-4db0-af62-42fc48cd59f6@googlegroups.com> Cancel-Lock: sha1:9km/290ig6Z/8z+/FODOEfGmkCw= Xref: csiph.com comp.lang.java.programmer:31128 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. Is one such discussion. Probably more, you might try searching there.