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 PostHow are you creating the file ? If it is done with an absolute path then we need to see the code to tell you what might be going wrong. If it is created with a relative path in your program then the file certainly won't be created in the …
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.
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.