Page 1 of 1

How to switch Java Version used by Servoy Developer

PostPosted: Wed Oct 26, 2016 7:05 pm
by Bernd.N
On a new Win10 machine, we installed several Java Versions, as an iReport 5.5 we still use needed a quite old Java version (1.6.25 when I remember it right).
As a consequence, that machine has now three Java installed like this.
How can I tell Servoy to use Java 111?

java_infos.png
java_infos.png (17.22 KiB) Viewed 7652 times


A bit strange is that when I open DOS and type "java -version", it answers with "java version 1.8.0_66", although the 111 is activated in the picture above.

In the Servoy Application Server I can see it uses Java 66.
So I guess that is used also by the Servoy Developer, right?

app_server_infos.png
app_server_infos.png (59.42 KiB) Viewed 7652 times

Re: Which Java is used by my Servoy Developer?

PostPosted: Thu Oct 27, 2016 7:39 am
by Peter de Groot
Hi,

Open the servoy admin via the help menu,

2016-10-27_0735.png
2016-10-27_0735.png (19.86 KiB) Viewed 7630 times


There you'll find the JAVA version

sv_admin.png
sv_admin.png (56.71 KiB) Viewed 7630 times


Regards,

Peter

How to switch Java Version used by Servoy Developer

PostPosted: Thu Oct 27, 2016 9:49 am
by Bernd.N
Sorry, Peter, my topic header wasn't choosen very good, I changed it now. :)

Re: How to switch Java Version used by Servoy Developer

PostPosted: Wed Nov 02, 2016 8:27 pm
by Andrei Costescu
You don't need to change the active installed java.
Developer can be configured to run using any Java by adding this:

Code: Select all
-vm
c:\Program Files\Java\jdk1.7.0_51\bin\java.exe

in the developer/servoy.ini file. Make sure you add it somewhere before -vmargs (you can add it right above that) so that it's not interpreted as a vm arg.
Also you can use there javaw.exe instead of java.exe to avoid the backgound console window.

For the stand-alone app. server you know how to do it right?

Re: How to switch Java Version used by Servoy Developer

PostPosted: Wed Nov 02, 2016 10:23 pm
by Bernd.N
Thank you, that worked well!

I added in my case
Code: Select all
-vm
C:\Program Files\Java\jdk1.8.0_111\bin\javaw.exe

And I have the feeling that the solution is more snappy now. In any case it is a good feeling to use the latest java.

Andrei Costescu wrote:For the stand-alone app. server you know how to do it right?

Not really, although I looked through the docs, though I could have missed that section:
https://wiki.servoy.com/display/Serv7/Application+Server
Could you please tell me?

Re: How to switch Java Version used by Servoy Developer

PostPosted: Thu Nov 03, 2016 3:12 pm
by Andrei Costescu
You are welcome.

When using servoy application server stand-alone install as a service:
- change this configuration option in "[...]\application_server\service\wrapper.conf": wrapper.java.command . I am not sure if the service needs to be reinstalled or not but I think not.
(see http://wrapper.tanukisoftware.com/doc/e ... s-jvm.html or http://wrapper.tanukisoftware.com/doc/e ... rties.html for all kinds of other service wrapper config options)

When using servoy application server stand-alone install started using the bat/sh scripts:
- you could manually edit the script files and replace "$CMD_LINE_START"/"%CMD_LINE_START%" in the line which starts app. server with the java executable that you want
- you can set CMD_LINE_START env. variable to point to the java.exe that you want (for windows you also have to set CMD_LINE_CHANGED=yes)

If you are using war deployment check your container documentation on how to specify the java version that it is using. For example Tomcat looks at JAVA_HOME and JRE_HOME which can be globally specified or, depending on your OS, you can also put it in setenv.bat or some other config file to make it not affect the whole system; if you are using it as a service then you need to configure the service and so on. If you are not the one hosting that container just ask the hosting ppl. about that.

I will see if this can be added in wiki.

Re: How to switch Java Version used by Servoy Developer

PostPosted: Thu Nov 03, 2016 4:02 pm
by Bernd.N
Ok, thanks again!