[TIP] Clear Java cache and .servoy folder by command line

Thanks to my collegue Mark Voorboom, you can now clear your Java cache AND empty your .servoy folder by commandline or by executing a single .bat file.
Just past this code into a text file and save it as ‘clear_servoy_cache.bat’:

javaws -uninstall
DEL /Q "%USERPROFILE%\.servoy"

When launching the file, your Java cache and .servoy folder will be cleared! 8)
I don’t know what happens if you let this script run from a Servoy client,
but I can imagine it could be a nice way for end users to reset everything and download the client (as clean install option) again.

PS: more java options can be found in the console/terminal by typing: javaws

be aware, this is windows-only! and also, removing ALL your javaws cache, so that means, if you use other webstart application, those are gone too!

and I think cannot be fired from a Servoy client, because, after closing the Servoy client, the cache is back, right?

For Mac users the command can be executed by:

javaws -uninstall
rm -r ~/.servoy

This will empty your -complete- Java cache and deletes your .servoy folder
Again, I’m not sure what it does when you run this from the client.

I would make that :

javaws -uninstall
rm -r ~/.servoy

This way you are sure it runs from your home directory.

Thanks Robert, I’ve modified the code.

ROCLASI:
I would make that :

javaws -uninstall

rm -r ~/.servoy



This way you are sure it runs from your home directory.

Hi Robert!

Where is the difference in your code compared to Karel’s?
I would like to make “rm -rf ~/.servoy” for mac terminal commad, or?

Hi Thomas,

Karel updated his post to match my code so his old code is not visible now.
But what he missed was the ~/ bit which means someones home directory.
So if you do cd ~ you go straight to the home directory of the logged in user without having to type it all out like cd /Users/thomas/ .

Is there anyway way to take this to the next level and set the Network Connection to Direct Connection and then hit the server’s client download page and start the download of the servoy client?

We’re using Citrix so we have to do this a lot because some clients don’t always get the latest solutions downloaded when they launch their client.

Thanks in advance!

Mostly in controlled Citrix environments you dont have the rights to set the java connection mode. And in such environment everything should and can be controlled by the IT department!! (If they have the knowledge ;-) )

Yes, but we’ve opened up that access to the users because they have to download fresh copy of Servoy so often.

I would like them to be able to launch a bat file that would compbne all the steps for them.

setting the network connection to direct connection is only needed if you have 2 way socket as the tunnel mode

if you use Socket or Http&Socket then you are fine and servoy should start just as fine with the default settings.

Thanks all for this post. This post got me thinking …

Opening the Java Control Panel and modifying the settings (the security settings –specifically) is something that the users of our solutions need to do routinely –at least every time after their Java Update is run.

I constantly has to remind the users on what to do when their Servoy solution does not start. Commonly, all they need to do is to lower to the least security setting on the Java Console Panel (which is now “medium”).

Modifying this Java Control Panel setting manually is the least desirable way to do this because the users always contact me about what to do, it is time consuming issue to solve and prone to error.

Would be possible for Servoy to build within the client start (perhaps before the web start is launched) a program that checks the Java settings and runs the (windows, osx or linux) commands to change the Java security settings, etc.?

It seems that this should be doable.

See this page: http://docs.oracle.com/javase/7/docs/te … rties.html

Perhaps, this new start script of Servoy Smart Client should:

  1. Adjust the deployment.properties file via script (saving the original).
  2. Optionally, start the Java Control Panel via script so that an advanced user can verify that the Java Control Panel has successfully used the updates from the deployment.properties file to the registry keys DeploymentProperties.
  3. Terminate the javaw process which runs the Java Control Panel.
  4. Then run the Servoy Smart Client normally.

The idea is that the deployment.properties should be optimized by Servoy so that the Smart Client starts without inconvenient.

Is this possible? Can this be a feature request?

JC

Just get your security together! Buy yourself your iwn signing certificate! Codesign it with the codesign tool on ServoyForge, best is to install also an SSL certificate in Tomcat of Servoy, set the Smart-client to tunnel http-mode and youre done! Security can be set to the highest and smartclient will run smootly

Harjo:
Just get your security together! Buy yourself your iwn signing certificate! Codesign it with the codesign tool on ServoyForge, best is to install also an SSL certificate in Tomcat of Servoy, set the Smart-client to tunnel http-mode and youre done! Security can be set to the highest and smartclient will run smootly

Harjo, thank you very much! This makes a lot of sense for security purpose.

What about for the other issues discussed/hinted in this post? Servoy could (optionally) offer a start of the smart client with the option to clear the Java cache AND/OR empty your .servoy folder, etc. Perhaps as an option that can be set in the Server web console? Just an idea from a Servoy user/developer. Can this be a feature request?

jcarlos:
What about for the other issues discussed/hinted in this post? Servoy could (optionally) offer a start of the smart client with the option to clear the Java cache AND/OR empty your .servoy folder, etc. Perhaps as an option that can be set in the Server web console? Just an idea from a Servoy user/developer. Can this be a feature request?

I don’t see how on earth Servoy can control that. Servoy can only start something, after the client (java webstart) is downloaded, and if the client is not started right (somehow) Servoy can’t do nothing.
After setting up security, and running in http-tunnel mode, we almost had never clear any cache or .servoy folder…

as harjo said we can’t really do that, at least not in the client itself because then you are always to late.
To disable a bit more “caching” you could change on the admin page 2 properties:

servoy.clientJarLoadOption:
servoy.fastClientStartup:

make sure the first one is on “eager” and the second one is on “false”

If you want to do more, then give your users a batch file that they have to click on and you delete in that batch file all the stuff that you want (or modify everything you want)

Harjo, Johan:

Thank you very much for the clarification. This issue is now very clear.

Best, JC