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

Share business templates, ideas, experiences, etc with fellow Servoy developers here

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

Postby Karel Broer » Tue Jan 26, 2010 1:51 pm

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
Karel Broer
ServoyCamp - http://www.servoycamp.com
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

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

Postby Harjo » Tue Jan 26, 2010 1:59 pm

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?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

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

Postby Karel Broer » Tue Jan 26, 2010 2:12 pm

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.
Last edited by Karel Broer on Tue Jan 26, 2010 2:35 pm, edited 2 times in total.
Karel Broer
ServoyCamp - http://www.servoycamp.com
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

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

Postby ROCLASI » Tue Jan 26, 2010 2:16 pm

I would make that :
Code: Select all
javaws -uninstall
rm -r ~/.servoy

This way you are sure it runs from your home directory.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

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

Postby Karel Broer » Tue Jan 26, 2010 2:37 pm

Thanks Robert, I've modified the code.
Karel Broer
ServoyCamp - http://www.servoycamp.com
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

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

Postby tgs » Tue Jan 26, 2010 6:23 pm

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?
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

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

Postby ROCLASI » Tue Jan 26, 2010 7:34 pm

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/ .
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

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

Postby Providence1 » Fri Apr 11, 2014 8:10 pm

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!
Providence
Providence1
 
Posts: 456
Joined: Tue Aug 17, 2004 2:36 am
Location: New York, NY

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

Postby Harjo » Fri Apr 11, 2014 8:47 pm

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 ;-) )
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

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

Postby Providence1 » Fri Apr 11, 2014 9:57 pm

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.
Providence
Providence1
 
Posts: 456
Joined: Tue Aug 17, 2004 2:36 am
Location: New York, NY

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

Postby jcompagner » Mon Oct 06, 2014 4:52 pm

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.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

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

Postby jcarlos » Mon Oct 13, 2014 8:17 pm

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
Last edited by jcarlos on Tue Oct 14, 2014 8:50 pm, edited 1 time in total.
Juan-Carlos Sanchez, Stanford University - Law and Economics
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

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

Postby Harjo » Mon Oct 13, 2014 9:35 pm

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 Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

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

Postby jcarlos » Mon Oct 13, 2014 10:49 pm

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?
Juan-Carlos Sanchez, Stanford University - Law and Economics
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

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

Postby Harjo » Tue Oct 14, 2014 9:06 am

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...
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Next

Return to Sharing Central

Who is online

Users browsing this forum: No registered users and 4 guests

cron