Having trouble with this excercise on consuming tokens I am trying studying

no matter what I keep getting the same error message when I run it?
No description
12 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @stapps! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Kyo-chan
Kyo-chan2y ago
I mean, you seem to try and open a file. Do you know where is the file?
stapps
stappsOP2y ago
I needed to make a file name weather.txt? The teacher was never really clear on that
Kyo-chan
Kyo-chan2y ago
We're not gonna guess what's your assignment. We don't know what you're given and what you did yourself
stapps
stappsOP2y ago
Ah my b I'm basically just looking at a program that was the answer toa prompt he did in a lecture I will post it in a sec
stapps
stappsOP2y ago
No description
No description
Kyo-chan
Kyo-chan2y ago
Then yeah, you're supposed to have a file. If you ask me, that was actually rather straightforwardly put
stapps
stappsOP2y ago
in an actual folder on my computer? can it be anywhere? or does it have too be in the same folder as dr.java or the progam itsself?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Kyo-chan
Kyo-chan2y ago
It needs to be named right and to be at the right place. As I don't know DrJava though, I don't know what's the right place to put files at You could try
System.out.println(Paths.get("file-in-current-dir.txt").toAbsolutePath());
System.out.println(Paths.get("file-in-current-dir.txt").toAbsolutePath());
That program will show you where files are expected
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JavaBot
JavaBot2y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.
Want results from more Discord servers?
Add your server