File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,9 @@ This example wraps an [open-source Java library](https://github.com/gazman-sdk/q
12
12
git clone https://github.com/gazman-sdk/quadratic-sieve-Java
13
13
cd quadratic-sieve-Java
14
14
sh ./gradlew jar
15
+ cd ..
15
16
```
16
17
17
- Then, copy the resulting Jar file (` ./build/libs/QuadraticSieve-1.0.jar ` ) into the ` Samples/JavaSieve ` directory.
18
-
19
18
Now we're ready to build and run the Swift program from ` Samples/JavaSieve ` :
20
19
21
20
```
Original file line number Diff line number Diff line change 15
15
import JavaKit
16
16
import JavaMath
17
17
18
- let jvm = try JavaVirtualMachine . shared ( classpath: [ " QuadraticSieve-1.0.jar " ] )
18
+ let jvm = try JavaVirtualMachine . shared ( classpath: [
19
+ " quadratic-sieve-Java/build/libs/QuadraticSieve-1.0.jar " ,
20
+ " . " ,
21
+ ] )
22
+
19
23
do {
20
24
let sieveClass = try JavaClass < SieveOfEratosthenes > ( environment: jvm. environment ( ) )
21
25
for prime in sieveClass. findPrimes ( 100 ) ! {
Original file line number Diff line number Diff line change 1
1
{
2
- "classpath" : "QuadraticSieve-1.0.jar",
2
+ "classpath" : ".:quadratic-sieve-Java/build/libs/ QuadraticSieve-1.0.jar",
3
3
"classes" : {
4
4
"com.gazman.quadratic_sieve.QuadraticSieve" : "QuadraticSieve",
5
5
"com.gazman.quadratic_sieve.core.BaseFact" : "BaseFact",
You can’t perform that action at this time.
0 commit comments