why my executable jar file created in Netbeans cant write/output a .txt file. . .my program must create a text file and write with it, how can it doesn't work when i convert it to .jar but if i run it in netbeans it work fine?..
viber101 -1 Light Poster
Recommended Answers
Jump to PostDefine what you mean by "can it doesn't work".
Do you have any errors or exception StackTraces to help us go on ?
Jump to PostShow me some code, on how you are creating your file, also the exact command how you are executing your jar file.
Jump to Postjava -jar "/home/viber/JAVAFINAL/dist/JAVAFINAL.jar"
Now I see the reason for the problem. I am guessing your username is "viber" on your computer and you are running this application is user "viber" and your O.S is Unix/Linux based.
Now when you create the "txt" file what path have …
Jump to PostLike it has already been mentioned, post your code which can be compiled and tested to reproduce the exact problem.
Jump to PostSince you are already getting an exception, can you print out the exact StackTrace of what is being thrown up at you.
java.lang.NullPointerException
s occur when you are trying to invoke a method/access a property etc on an object reference set to Null.For e.x. the following code …
All 17 Replies
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
viber101 -1 Light Poster
viber101 -1 Light Poster
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
viber101 -1 Light Poster
verruckt24 438 Posting Shark
viber101 -1 Light Poster
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
viber101 -1 Light Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
viber101 -1 Light Poster
viber101 -1 Light Poster
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
viber101 -1 Light Poster
viber101 -1 Light Poster
verruckt24 438 Posting Shark
viber101 -1 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.