java - Filewriter-Printwriter not working with jar on linux -


i have pieace of code:

    calendar ca=calendar.getinstance();     filewriter fw = new filewriter("locations_elapsed time iterations.txt", true);     printwriter pw = new printwriter(fw);                   ca.settime(new date());                           a++;     pw.write("user " + + " " + ca.get(calendar.millisecond));     pw.println();     pw.close(); 

it works fine when run netbeans (ofcourse). want execute on server away machine works linux, make jar file this.

the problem is not writing anything. ideas?

thanks!

i can't comment yet: can give little more detail happens when launch jar? how launch it? file calling stored?
@ first glance think don't have exception handling , cannot see file hasn't been found or on like.
way, suggest (for testing purposes) use files.write


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -