You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,9 @@ SQL Developer is slowly reaching the end of its life cycle. The days when SQL De
23
23
24
24
A new SQLcl version typically comes with enhancements and bug fixes in the area of PL/SQL and SQL grammar. And this also requires an adaptation of the formatting rule due to symbol name changes etc. And as a result, these formatting rules can actually only be used in SQLcl.
25
25
26
-
However, we know that the grammars and the formatter are provided in a JAR called `dbtools-common.jar`. And this JAR file also exists in the SQL Developer distribution. This means that in order to be able to use the current formatting rules in SQL Developer, we have to copy the `dbtools-common.jar` file from SQLcl to SQL Developer as follows:
26
+
However, we know that the grammars and the formatter are provided in a JAR called `dbtools-common.jar`. And this JAR file also exists in the SQL Developer distribution. This means that in order to be able to use the current formatting rules in SQL Developer, we have to copy the `dbtools-common.jar` file from SQLcl to SQL Developer. Unfortunatelly the classes are not 100% compatible with the SQL Developer. As a a result, we have to keep some original classes, which complicates the patching process a bit.
27
+
28
+
Here's the full procedure to use `dbtools-common.jar` from SQLcl 23.4.0 in SQL Developer 23.1.1.345:
27
29
28
30
1. Quit SQL Developer
29
31
@@ -37,11 +39,31 @@ However, we know that the grammars and the formatter are provided in a JAR calle
37
39
38
40
Find the `dbtools-common.jar` in your SQLcl installation. In our case it's in `/usr/local/bin/sqlcl/lib`. Copy the file to the SQL Developer’s directory (where `dbtools-common.original.jar` is located).
39
41
40
-
4. Start SQL Developer
42
+
4. Patch SQLcl's `dbtools-common.jar`
43
+
44
+
Open a terminal window in the `lib` folder where `dbtools-common.original.jar` and `dbtools-commmon.jar` are located and run the following commands to copy the class `oracle.dbtools.parser.ParserNode.class` to `dbtools-common.jar`:
45
+
46
+
```bash
47
+
jar -xvf dbtools-common.original.jar oracle/dbtools/parser/ParseNode.class
48
+
jar -u0vMf dbtools-common.jar oracle/dbtools
49
+
rm -rf oracle
50
+
```
51
+
52
+
This step is necessary to ensure that the "Code Outline" continues to work in SQL Developer.
53
+
54
+
5. Clear SQL Developer's cache
55
+
56
+
Delete the following directory:
57
+
58
+
- On Windows: `%APPDATA%\SQL Developer\system23.1.1.345.2114\system_cache`
59
+
- On other platforms: `$HOME/.sqldeveloper/system23.1.1.345.2114/system_cache`
60
+
61
+
This step is necessary to ensure no other version of `dbtools-common.jar` is used from the cache. You will all
62
+
window settings. However, all other preferences including your connections are preserved.
41
63
42
-
Open an editor and test if the formatter is working.
64
+
6. Start SQL Developer
43
65
44
-
We have successfully tested this procedure with SQL Developer 23.1.1. However, there were cases in the past where this did not work. For example, using the JAR of SQLcl 20.3.0 in SQL Developer 20.2.0. Replacing a JAR requires a certain level of compatiblity. We therefore expect that this procedure will no longer work with an upcoming version of SQLcl. We will update this section as soon as we know more.
66
+
Open an editor and test if the formatter and code outline is working.
0 commit comments