How to specify Java Home/JDK in Oracle SQL Developer?

With reference to the above-mentioned title, the path has been given at the time of opening SQL Developer for the first time. Now I need to change the path.

Can anyone help me or guide me to do this?

If you need to change the path for SQL Developer (such as the path to the JDK or another configuration path), you can follow these steps depending on what path you are referring to:

1. Change the JDK Path in SQL Developer

If you need to change the JDK path that SQL Developer uses:

  1. Close SQL Developer if it’s open.

  2. Locate the product.conf file:

    • On Windows, it’s typically found at:
      %APPDATA%\sqldeveloper\<version>\product.conf
      
    • On macOS/Linux, it’s usually located at:
      ~/.sqldeveloper/<version>/product.conf
      
  3. Edit the product.conf file:

    • Open the product.conf file in a text editor.
    • Look for the line that specifies the SetJavaHome parameter. It will look something like this:
      SetJavaHome <path_to_your_jdk>
      
    • Change the path to the new JDK path you want to use.
  4. Save the file and restart SQL Developer. The application should now use the new JDK path.

2. Change the SQL Developer Configuration Path (Other Paths)

If you need to change other configuration paths, such as the location of your user-defined reports, SQL Developer user preferences, or other settings, you’ll generally need to:

  1. Close SQL Developer if it’s open.

  2. Locate the appropriate configuration files (this varies depending on what you’re trying to change):

    • Reports: Usually found in a folder like ~/.sqldeveloper/system<version>/reports.
    • Preferences: Stored in the user settings folder (~/.sqldeveloper/system<version>/).
  3. Edit the relevant configuration files:

    • For instance, if you want to move user preferences or reports to a new location, you might need to manually copy files or change paths within the configuration files.
  4. Restart SQL Developer after making the changes.

3. Reconfigure SQL Developer Paths Through GUI (Where Applicable)

In some cases, SQL Developer allows you to change paths through the application itself:

  1. Open SQL Developer.
  2. Navigate to Tools > Preferences.
  3. Look for the specific settings you want to change:
    • For example, changing the location of SQL history, database connections, etc.
  4. Adjust the paths as needed.

This method is more user-friendly but may not be available for all types of path changes.

4. Delete the Configuration and Reconfigure (JDK Path)

If the JDK path prompt appears on the first launch and you want to trigger it again:

  1. Delete the product.conf file:

    • Remove the product.conf file from the location mentioned above.
  2. Re-launch SQL Developer:

    • SQL Developer will prompt you to enter the JDK path again.

This method is a bit more brute force but will let you reset the JDK path without manually editing files.