Failed to compile Couchbase lite with Java on Windows

F:\RAVI\COUCHLITE\couchbase-lite-java>gradlew build
:libraries:couchbase-lite-java-core:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
:libraries:couchbase-lite-java-core:processResources UP-TO-DATE
:libraries:couchbase-lite-java-core:classes
:libraries:couchbase-lite-java-core:jar
:libraries:couchbase-lite-java-native:compileJava
:libraries:couchbase-lite-java-native:processResources UP-TO-DATE
:libraries:couchbase-lite-java-native:classes
:libraries:couchbase-lite-java-native:compileWindows_amd64Native_librarySharedLi
braryNative_libraryC
com_couchbase_lite_storage_JavaSQLiteStorageEngine.c
log.c
sqlite3.c
sqlite_json_collator.c
F:\RAVI\COUCHLITE\couchbase-lite-java\libraries\couchbase-lite-java-native\src\m
ain\c\sqlite_json_collator.c(301) : error C2143: syntax error : missing ‘;’ befo
re ‘const’
F:\RAVI\COUCHLITE\couchbase-lite-java\libraries\couchbase-lite-java-native\src\m
ain\c\sqlite_json_collator.c(303) : error C2065: ‘str1’ : undeclared identifier
F:\RAVI\COUCHLITE\couchbase-lite-java\libraries\couchbase-lite-java-native\src\m
ain\c\sqlite_json_collator.c(303) : warning C4047: ‘function’ : ‘const char *’ d
iffers in levels of indirection from ‘int’
F:\RAVI\COUCHLITE\couchbase-lite-java\libraries\couchbase-lite-java-native\src\m
ain\c\sqlite_json_collator.c(303) : warning C4024: ‘uca_string_compare’ : differ
ent types for formal and actual parameter 1
:libraries:couchbase-lite-java-native:compileWindows_amd64Native_librarySharedLi
braryNative_libraryC F
AILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:libraries:couchbase-lite-java-native:compileWindows_
    amd64Native_librarySharedLibraryNative_libraryC’.

C compiler failed; see the error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

Total time: 16.985 secs

JDK in use:
F:\RAVI\COUCHLITE\couchbase-lite-java>java -version
java version “1.8.0_25”
Java™ SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot™ 64-Bit Server VM (build 25.25-b02, mixed mode)

Installed Microsoft Visual Studio 2013 on Windows 7

Hey @ravishanker12,

Are all the JARs in your build path and JDK 1.7+ is required for:

Hi @ravishanker12,

I just compiled Couchbase Lite Java on Windows this week. Compilation works fine with my environment.

With your build environment, the compilation failed for couchbase-lite-java-native. I assume the compilation error was caused by Visual Studio. I used latest Visual Studio 2015 community edition that I downloaded from https://www.visualstudio.com/ . Purple one.

If reinstalling Visual Studio does not work, please let us know!

Hope this helps!

Hideki

Thanks @hideki… I have installed Visual Studio 2013 and verified. Will try with Visual Studio 2015.

@hideki: Could you provide the compiled dll binaries somewhere? I’m still downloading (6Gib+) VS and haven’t even gotten to the stage I can compile the libraries yet…

Hi @matheusd,

I posted couchbase-lite-java-native.jar that I built on Windows 2012. It contains DLLs.

Please let us know if it works.

Thanks!

Hello @hideki,

Thanks, it seems to have worked (on an win7, x64 machine).

Hi @matheusd,
Thank you for your update. I am glad to hear CBL Java works on your Windows environment.
couchbase-lite-java-native.jar I posted was compiled on my development and test Windows machine. Please build jar file on your build machine for your official release.
Cheers!

Thank you for the compiled jar, it was really helpful. I was having trouble compiling it myself.

Cheers!