Question

I have desktop application. I do jar-file, but I have file into this jar what is needed to be change. I use TrueZip <> I tried:

OutputStream out = new FileOutputStream("myjar.jar"+"/com/mycompany/confProperties.properties");
try{
    properties.store(out, "Changed by User");}
finally{
    out.close();
}
TFile.umount();

It work with Eclipse, but when I execute my jar from command line I have exception:

java.io.FileNotFoundException: myjar.jar/com/mycompany/confProperties.properties
at de.schlichtherle.truezip.file.TFileOutputStream.newOutputStream(TFileOutputStream.java:147)
at de.schlichtherle.truezip.file.TFileOutputStream.<init>(TFileOutputStream.java:83)

If I use only "/com/mycompany/confProperties.properties" instead of "myjar.jar"+"/com/mycompany/confProperties.properties", I have

java.io.FileNotFoundException: \com\fujitsu\gdcru\accesschecker\client\confProperties.properties
at de.schlichtherle.truezip.file.TFileOutputStream.newOutputStream(TFileOutputStream.java:147)
at de.schlichtherle.truezip.file.TFileOutputStream.<init>(TFileOutputStream.java:83)

Can I change this file? And how?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top