Josh Bern

Greenhorn
+ Follow
since Nov 19, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Josh Bern

I'm unsure how to make the text file appear in the dist folder besides the jar and how to write to it when the jar is run. I changed the path to this:



...and draged the text file to the dist folder by the jar. I type this in the command prompt:

C:\Documents and Settings\myName>java -jar "C:\Documents and Settings\myName\My Do
cuments\NetBeansProjects\myProject\dist\myjar.jar"


//When about to read in the file, not writing yet, this error materializes:
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at MyMain.main(QuestionMain.java:27)
14 years ago
Yo Wouter Out, thanks. Ok say I want to store simple text data inbetween runs, is my best option to store a text file in the same directory as the JAR? I'd love to bake it in somehow, but it's not worth it if it's too complicated.
14 years ago
Hi people, I'm new and this forum seems active!
I'm using NetBeans IDE and my directory structure looks like this:


I tried writing to a text file in the jar, can you folks see what's causing the exception in the command prompt when the following class is run in console like: java -jar "mypath/myjar.jar"? Thanks!


Exception in thread "main" java.lang.IllegalArgumentException: URI is not hierarchical
14 years ago