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
| 1.18 | VS 2013 (12) Windows SDK 7.1A | 1.6.0 (50) | 1.8.4 Eclipse Embedded | Eclipse 4.3 | 32 and 64 bit |
65
+
| 1.19 | VS 2013 (12) Windows SDK 7.1A | 1.8.0 (52) | 1.10.1 Eclipse Provided | Eclipse 4.7 | 32 and 64 bit |
66
+
| 1.20 | VS 2019 (16) Windows SDK 10 | 1.8.0 (52) | 1.10.8 Eclipse Provided | Eclipse 2020 09 | 32 and 64 bit |
67
+
| 1.21 | VS 2022 (17) Windows SDK 11 10.0.22621.0 | 17 | VSCode provided | VSCode | 32 and 64 bit |
69
68
70
69
Microsoft Visual Studio 2019 supports 64 bit builds. so no additional tools are required.
71
70
@@ -85,7 +84,56 @@ The build process is based on ANT. You can run ANT from inside of eclipse or fro
85
84
***test** runs all the tests
86
85
* One of the Excel unit tests is hard coded against Office 2019 32 bit.
87
86
88
-
## Eclipse Java IDE
87
+
## Visual Studio IDE
88
+
89
+
You can open `jacob-project` in VS Code
90
+
91
+
1. Open VS Code
92
+
2. Install the Java extensions
93
+
3. Install the ANT extension
94
+
4. Open the jacob project directory
95
+
5. Run the ANT default target to build the pieces
96
+
97
+
### Running tests in VS Code with ANT
98
+
99
+
The tests now sit in src/test. You can run all the tests with the `ANT target runner` if you installed the extension
100
+
101
+
### Running tests in VS Code with the test runner.
102
+
103
+
1. Build the dll and compile the java code using the default `Ant` target.
104
+
2. Create a `.vscode/settings.json` file with the following configuration in it. This makes the Jacob DLL accessible to the tests by setting `java.library.path`
105
+
3. Adjust the java location to your JDK location
106
+
4. You can now run any of the tests from the Test Runner panel. Debugging and breakpoints should work
Copy file name to clipboardExpand all lines: docs/UsingJacob.md
+42-9Lines changed: 42 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Section not yet written.
22
22
23
23
## The Jacob DLL
24
24
25
-
Jacob.jar relies on a DLL file that it loads off of the library path or classpath. This means that you must either copy the appropriate jacob dll into your path or use VM options to add directory holding jacob dll to the path. Prior to 1.14M6, the jacob DLL name was always "jacob.dll". This made it hard to verify jacob was loading the correct dll when multiple copies of jacob were installed on a single system. It also was confusing on 64 bit systems where the 32 bit and 64 bit dlls have the same tames. Starting in 1.14M6, Jacob's library loader selects a dll with the appropriate name based on the jacob release and platform. The dll naming convention is:
25
+
Jacob.jar relies on a DLL file that it loads off of the library path or classpath. This means that you must either copy the appropriate jacob dll into your path or use VM options to add directory holding jacob dll to the path. Prior to 1.14M6, the jacob DLL name was always "jacob.dll". This made it hard to verify jacob was loading the correct dll when multiple copies of jacob were installed on a single system. It also was confusing on 64 bit systems where the 32 bit and 64 bit dlls have the same tames. Starting in 1.14M6, Jacob's library loader selects a dll with the appropriate name based on the jacob release and platform. The dll naming convention is:
26
26
`jacob<platform>.<version.>.dll`
27
27
28
28
Classloader issues
@@ -39,9 +39,10 @@ Jacob 1.13 is built with VC++ 2005 that creates a dependency on msvcr80.dll. Win
39
39
40
40
If you see the following message then you probably don't have the right C++ libraries.
41
41
42
-
<pre> Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\apps\...\jacob.dll: This application has
43
-
failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
44
-
</pre>
42
+
```txt
43
+
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\apps\...\jacob.dll: This application has
44
+
failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
45
+
```
45
46
46
47
[Visual C redistributable installer SP1](http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en)
47
48
@@ -108,7 +109,7 @@ Setting this flag to false causes Jacob to check the and <class_name>.PutInROT p
108
109
<tdvalign="top">
109
110
<class_name>.PutInROT
110
111
</td>
111
-
<td>Lets a program specify that instances of certain classes are to not be inserted into the ROT. This experimental (1.13) feature provides a mechanism for freeing VariantViaEvent objects that are created in Event threads. There is normally no way to free those objects because the thread terminates outside of any normally MTA/STA Startup/Teardown code. Each event occurs in a new thread and creates a new ROT entry so they grow without bounds.This option may cause VM crashes in certain situations where windows memory is freed outside of the thread it was created in but empirical evidence shows there are situations where this great reduces the long running memory footprint of applications that process a lot of events. _This function is still experimental_. The functionality was added 1.13\. Some of this overlaps the experimental `com.jacob.autogc` introduced in 1.9\. See the ROT.java test program for an example of the effects of this option.This value is checked every time and can be changed on-the-fly via `System.setProperty();`Example: `System.setProperty("com.jacob.com.VariantViaVariant.PutInROT","false");`
112
+
<td>Lets a program specify that instances of certain classes are to not be inserted into the ROT. This experimental (1.13) feature provides a mechanism for freeing VariantViaEvent objects that are created in Event threads. There is normally no way to free those objects because the thread terminates outside of any normally MTA/STA Startup/Teardown code. Each event occurs in a new thread and creates a new ROT entry so they grow without bounds.This option may cause VM crashes in certain situations where windows memory is freed outside of the thread it was created in but empirical evidence shows there are situations where this great reduces the long running memory footprint of applications that process a lot of events. _This function is still experimental_. The functionality was added 1.13\. Some of this overlaps the experimental `com.jacob.autogc` introduced in 1.9\. See the ROT.java test program for an example of the effects of this option.This value is checked every time and can be changed on-the-fly via `System.setProperty();`Example: `System.setProperty("com.jacob.com.VariantViaVariant.PutInROT","false");`
## Finding the DLL version using windows command line
138
138
139
139
The jacob.dll file includes the jacob release number in the version field. Run the following from the command prompt `dumpbin /version jacob.dll` . The dll version number is stored in the "image version" field of the "OPTIONAL HEADER VALUES" section. This information from [The Microsoft msdn web site](http://msdn2.microsoft.com/en-gb/library/h88b7dc8(VS.71).aspx)
140
140
141
-
***
142
141
143
142
## Unit Tests
144
143
145
-
Jacob must know the location of the DLL when running the unit tests in Eclipse. The simplest way to do this is to add the dll path to the unit as a VM argument. The argument should be specified based on where you installed the jacob source package. If you have jacob unpacked in c:/dev/jacob and built using build.xml, then the vm arguments would be:
Jacob must know the location of the DLL when running the unit tests from the command line or inside an IDE.
145
+
The simplest way to do this is to add the dll path to the unit as a VM argument.
146
+
The argument should be specified based on where you installed the jacob source package.
147
+
If you have jacob unpacked in c:/dev/jacob and built using build.xml, then the vm arguments would be:
148
+
`-Djava.library.path=c:/dev/jacob/release/x86` .
149
+
150
+
If you are running it from inside a test runner in an IDE like VSCode. Then you need to set up the runner to pass the DLL library location to all the tests
151
+
using `-Djava.library.path`
152
+
153
+
This is a sample workspace settings.json fragment that configures the dll and jars for the tests.
0 commit comments