RepreZen API Studio Desktop is built on the Eclipse Platform. The RepreZen executable in your program folder is an Eclipse Launcher which, by default, locates a suitable Java installation from the path and/or from standard Java installation folders. Starting with release 1.6.15, the API Studio Desktop installer overrides this default behavior by pre-configuring the launcher to run with the best available Java release. 

You can manually re-configure API Studio to run with a different Java installation. And you will need to re-configure or reinstall API Studio if you remove or relocate the Java installation API Studio is currently configured to use.

The steps to configure Java in the API Studio launcher will depend on your operating system. This article provides instructions for Windows and macOS in the following sections. 

Configuring a Specific JDK or JRE on Windows

1. Find the path to the Java installation you want to use

The related article on Java compatibility has current recommendations and technical considerations for selecting a Java version.  

You'll need the full path to the bin folder.

Usually, your Java installations can be found in the \Program Files\Java folder on your System (C:) drive. You may also wish to consult the Java control panel item. The appearance and some of the functionality may vary, depending on the version of Java you most recently installed.

Java 8 Control Panel:

Java 10 Control Panel:

2. Locate the RepreZen.ini file

The RepreZen.ini file is located next to RepreZen.exe in the installation folder. By default, that means you will find it at RepreZen\API_Studio\RepreZen.ini under your home folder.

3. Set the Java location in the RepreZen.ini file

Open the RepreZen.ini file in a text editor, and add these two lines to file, just before the existing -vmargs line:

-vm
<path to the JDK or JRE /bin subfolder>

Important: The -vm key and the path value must be on separate lines.

Here, "<path to the JDK or JRE /bin subfolder>" is based on the results of step 1. Make sure to use the \bin folder of your Java installation. After this change, the contents of RepreZen.ini should look similar to this: 

-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-pluginCustomization
plugin_customization.ini
-vm
C:\Program Files\Java\jdk1.8.0_191\bin
-vmargs
-Djavax.xml.accessExternalDTD=all
-Djava.net.preferIPv4Stack=true
-Xms256m
-Xmx512m
-XX:PermSize=192M
-XX:MaxPermSize=256M
-Djavax.xml.accessExternalDTD=all

4. Configure OSGi for your Java version.

RepreZen API Studio is built on the Eclipse Oxygen platform. Eclipse Oxygen, in its default configuration, is not compatible with Java 11. 

If you are running API Studio on Java 11, you'll need to add an org.osgi.framework.system.packages setting to the ./configuration/config.ini file under the installation folder, as explained here. This configuration value is specific to Java 11.

Open the ./configuration/config.ini file in a text editor, and look for an an org.osgi.framework.system.packages setting. If the setting is already present, it was most likely added by the API Studio installer, and should already be set to the correct value for Java 11. If that setting is not present in the file, insert a new line with the following configuration code, and save the file:
  

org.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.nimbus,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.ws.spi.http,javax.xml.ws.wsaddressing,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.portable,org.omg.CORBA.TypeCodePackage,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer.POAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServer.portable,org.omg.PortableServer.ServantLocatorPackage,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers

If you are running API Studio on Java 8, 9, or 10, you'll need to ensure that your ./configuration/config.ini file does not include the org.osgi.framework.system.packages setting.

Open the ./configuration/config.ini file in a text editor, and look for org.osgi.framework.system.packages setting. If that setting is present, remove it and save the file.

5. Verify that API Studio is using the correct JVM. 

Launch RepreZen API Studio, and check the value of the eclipse.vm setting in
Help > About RepreZen API Studio > Installation Details > Configuration.

Note: By default, the Eclipse launcher will try to locate and instantiate the virtual machine using jvm.dll, normally located in the bin/server subfolder. This allows the JVM to run inside the RepreZen.exe process, and may allow the application to load faster. In some cases, the launcher may run javaw.exe instead. You can control this by specifying the full path to javaw.exe or jvm.dll as the -vm argument in reprezen.ini.

Configuring a Specific JDK or JRE on macOS

1. Find of the location of the Java installation you want to use.

Open the Terminal and type:

/usr/libexec/java_home -V

This will print out the locations of all available Java installations, e,g, like this: 

The related article on Java compatibility has current recommendations and technical considerations for selecting a Java version.  

Based on the example above, a compatible Java 8 installation is shown in /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home. Note this location in your own output, as it will be used in step 3.

2. Locate the RepreZen.ini file

To do this, open the contents of the RepreZen.app by right-clicking on it and selecting "Show Package Contents":

The RepreZen.ini file is in the Contents > Eclipse folder:

3. Set the Java installation location in RepreZen.ini file

Open the RepreZen.ini file in a text editor, and add these two lines to file, just before the existing -vmargs line:

-vm
<location of the JDK or JRE /bin subfolder>

Important: The -vm key and the path value must be on separate lines.

Here, "<location of the JDK or JRE /bin subfolder>" is based on the results of step 1. Make sure to use the /bin folder of your Java installation. After this change, the contents of RepreZen.ini should look similar to this:

-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.300.v20150602-1417
-pluginCustomization
plugin_customization.ini
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin
-vmargs
-Djavax.xml.accessExternalDTD=all
-Djava.net.preferIPv4Stack=true
-Xms256m
-Xmx512m
-XX:PermSize=192M
-XX:MaxPermSize=256M
-Djavax.xml.accessExternalDTD=all
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

This will force RepreZen to always use Java 8. Now you can launch RepreZen as usual by double-clicking on RepreZen.app or using the Launchpad.

4. Configure OSGi for your Java version.

RepreZen API Studio is built on the Eclipse Oxygen platform. Eclipse Oxygen, in its default configuration, is not compatible with Java 11. 

If you are running API Studio on Java 11, you'll need to add an org.osgi.framework.system.packages setting to the ./configuration/config.ini file under the installation folder, as explained here. This configuration value is specific to Java 11.

Open the ./configuration/config.ini file in a text editor, and look for an an org.osgi.framework.system.packages setting. If the setting is already present, it was most likely added by the API Studio installer, and should already be set to the correct value for Java 11. If that setting is not present in the file, insert a new line with the following configuration code, and save the file:
  

org.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.nimbus,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.ws.spi.http,javax.xml.ws.wsaddressing,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.portable,org.omg.CORBA.TypeCodePackage,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer.POAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServer.portable,org.omg.PortableServer.ServantLocatorPackage,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers

If you are running API Studio on Java 8, 9, or 10, you'll need to ensure that your ./configuration/config.ini file does not include the org.osgi.framework.system.packages setting.

Open the ./configuration/config.ini file in a text editor, and look for org.osgi.framework.system.packages setting. If that setting is present, remove it and save the file.

5. Verify that API Studio is using the correct JVM. 

Launch RepreZen API Studio, and check the value of the eclipse.vm setting in
About RepreZen API Studio > Installation Details > Configuration.


Note: By default, the Eclipse launcher will try to locate and instantiate the virtual machine using libjvm.dylib, normally located in the lib/server subfolder. This allows the JVM to run inside the RepreZen process, and may allow the application to load faster. In some cases, the launcher may run the Java executable instead. You can control this by specifying the full path to Java or libjvm.dylib as the -vm argument in reprezen.ini.