Page 1 of 2

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

PostPosted: Tue Jan 26, 2010 1:51 pm
by Karel Broer
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':
Code: Select all
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

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

PostPosted: Tue Jan 26, 2010 1:59 pm
by Harjo
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?

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

PostPosted: Tue Jan 26, 2010 2:12 pm
by Karel Broer
For Mac users the command can be executed by:
Code: Select all
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.

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

PostPosted: Tue Jan 26, 2010 2:16 pm
by ROCLASI
I would make that :
Code: Select all
javaws -uninstall
rm -r ~/.servoy

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

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

PostPosted: Tue Jan 26, 2010 2:37 pm
by Karel Broer
Thanks Robert, I've modified the code.

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

PostPosted: Tue Jan 26, 2010 6:23 pm
by tgs
ROCLASI wrote:I would make that :
Code: Select all
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?

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

PostPosted: Tue Jan 26, 2010 7:34 pm
by ROCLASI
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/ .

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Fri Apr 11, 2014 8:10 pm
by Providence1
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!

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Fri Apr 11, 2014 8:47 pm
by Harjo
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 ;-) )

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Fri Apr 11, 2014 9:57 pm
by Providence1
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.

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Mon Oct 06, 2014 4:52 pm
by jcompagner
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.

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Mon Oct 13, 2014 8:17 pm
by jcarlos
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

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Mon Oct 13, 2014 9:35 pm
by 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

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Mon Oct 13, 2014 10:49 pm
by jcarlos
Harjo wrote: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?

Re: [TIP] Clear Java cache and .servoy folder by command lin

PostPosted: Tue Oct 14, 2014 9:06 am
by Harjo
jcarlos wrote: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...