This site requires JavaScript, please enable it in your browser!
Greenfoot back
Vellyxenya
Vellyxenya wrote ...

2016/2/16

Jar File

Vellyxenya Vellyxenya

2016/2/16

#
Hi, I tested exporting my project into a Jarfile. I can't open it on my computer because I have Java problems I don't know why. I sent it to a friend of mine, he can open it but when it comes to the buttons with the storage methods, it doesn't store... Is there also a storage file in the jar.file? Could information be stored in the .csv file like in Greenfoot?
danpost danpost

2016/2/16

#
UserInfo storage is not possible when exported as an Application Jar File. It is provided for your projects running within greenfoot for testing purposes only; so that when unloaded on the site you can make use of the limited storage provided through the UserInfo class. You will need to store the data in an external file (preferably in the same file directory as the jar file). Actually, it might be best to contain the data files with the jar file inside a separate folder -- that way you can move them as a single unit later, if needed.
Vellyxenya Vellyxenya

2016/2/17

#
Ok I see, so if I understood well, I must create like a txt file or so in the directory and replace the UserInfo methods with "writing-in-files methods" if I want to have an app that can store infos without internet?
danpost danpost

2016/2/17

#
Vellyxenya wrote...
Ok I see, so if I understood well, I must create like a txt file or so in the directory and replace the UserInfo methods with "writing-in-files methods" if I want to have an app that can store infos without internet?
Correct.
Vellyxenya Vellyxenya

2016/2/17

#
Ok thank you very much for the explanation :)
You need to login to post a reply.