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

**URL:** <https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671>\
**Category:** Classic Servoy\
**Created:** [January 26, 2010, 11:51am UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671 "2010-01-26T11:51:03Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [January 26, 2010, 11:51am UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/1 "2010-01-26T11:51:03Z")

</div>

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’:

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

```

When launching the file, your Java cache and .servoy folder will be cleared! ![8)]( "Cool")  
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

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [January 26, 2010, 11:59am UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/2 "2010-01-26T11:59:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [January 26, 2010, 12:12pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/3 "2010-01-26T12:12:39Z")

</div>

For Mac users the command can be executed by:

```auto
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.

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [January 26, 2010, 12:16pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/4 "2010-01-26T12:16:52Z")

</div>

I would make that :

```auto
javaws -uninstall
rm -r ~/.servoy

```

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

---

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [January 26, 2010, 12:37pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/5 "2010-01-26T12:37:38Z")

</div>

Thanks Robert, I’ve modified the code.

---

<div class="post-metadata">

**Author:** ![tgs](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tgs](https://forum.servoy.com/u/tgs)\
**Post date:** [January 26, 2010, 4:23pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/6 "2010-01-26T16:23:51Z")

</div>

> ROCLASI:  
> I would make that :
> 
> ```auto
> javaws -uninstall
> 
> ```

rm -r ~/.servoy

> ```auto
> 
> 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?

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [January 26, 2010, 5:34pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/7 "2010-01-26T17:34:16Z")

</div>

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/ .

---

<div class="post-metadata">

**Author:** ![Providence1](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Providence1](https://forum.servoy.com/u/Providence1)\
**Post date:** [April 11, 2014, 6:10pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/8 "2014-04-11T18:10:23Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [April 11, 2014, 6:47pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/9 "2014-04-11T18:47:28Z")

</div>

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 ![;-)]( "Wink") )

---

<div class="post-metadata">

**Author:** ![Providence1](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Providence1](https://forum.servoy.com/u/Providence1)\
**Post date:** [April 11, 2014, 7:57pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/10 "2014-04-11T19:57:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 6, 2014, 2:52pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/11 "2014-10-06T14:52:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcarlos](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jcarlos](https://forum.servoy.com/u/jcarlos)\
**Post date:** [October 13, 2014, 6:17pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/12 "2014-10-13T18:17:17Z")

</div>

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](http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp/properties.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

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [October 13, 2014, 7:35pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/13 "2014-10-13T19:35:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jcarlos](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jcarlos](https://forum.servoy.com/u/jcarlos)\
**Post date:** [October 13, 2014, 8:49pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/14 "2014-10-13T20:49:42Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [October 14, 2014, 7:06am UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/15 "2014-10-14T07:06:40Z")

</div>

> 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…

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 14, 2014, 7:15am UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/16 "2014-10-14T07:15:56Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![jcarlos](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jcarlos](https://forum.servoy.com/u/jcarlos)\
**Post date:** [October 14, 2014, 2:57pm UTC](https://forum.servoy.com/t/tip-clear-java-cache-and-servoy-folder-by-command-line/11671/17 "2014-10-14T14:57:10Z")

</div>

Harjo, Johan:

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

Best, JC
