-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with .jar file and ./gradlew run #30
Comments
Hi, if your project managed to compile (and I'm sure your main class references the other classes in your other files), then there is no problems with the classpaths of the other files. A NullPointerException occurs when you expect to have an object but somehow the method you receive the object from returned null instead, and you try to call any method on the null. Maybe you could run your project in debug mode to see which method is returning null? You can also look at the stack trace to see where the exception occurs. |
Hi! Can I know what do you mean by running the main class? As in how do you run it? are you using "java Main" command? or ./gradlew run command? and I would like to see the details of the corresponding classes and the full error message. Thanks. |
I typed in ./gradlew run Exception in thread "main"
FAILURE: Build failed with an exception.
|
This is caused by your You need to handle the case where the storage file |
@AaronCQL I think if the file is not available, it will throw |
|
@mario7lorenzo Yes, the @SHAUNGOH97 My bad, it is your |
@AaronCQL Oh man I did not see that. I modified it and now it works:) Thanks alot @mario7lorenzo @CornCobs @AaronCQL |
Hi, in both cases when I created my .jar file and when I added gradle support to my project, when I ran the main class, they both would run and display the opening screen of Duke.
However, whenever I typed in any usual command like list or todo, it would lead to a
Exception in thread "main" java.lang.NullPointerException
I'm not sure how to fix this issue, is it something to do with the classpaths of the other files?
Would appreciate any help. Thanks:)
The text was updated successfully, but these errors were encountered: