dain / leveldb

Port of LevelDB to Java
Apache License 2.0
1.54k stars 429 forks source link

Google Guava PatternCompiler Issue #112

Closed ebitogu closed 5 years ago

ebitogu commented 5 years ago

Hello, thanks for taking the time to port this library to Java.

I am currently integrating this library into my JavaFX Application.

I am done with the project and I need to package the Application but I keep getting

error: PatternCompiler is not public in com.google.common.base; cannot be accessed from outside package uses com.google.common.base.PatternCompiler;

I am trying to Package the app using JLink.

I can't package the application because of the above error.

Please, can you help?

pcmind commented 5 years ago

You need provide more information. To my knowledge PatternCompiler is not used by LevelDb. Guava used by LevelDb is shaded to a distinct package: "com.google.thirdparty". What is your JDK version? Stacktrace?...

ebitogu commented 5 years ago

@pcmind Thanks for taking the time to respond. I truly appreciate.

I have very little experience with Gradle though.However, I am building the application using JavaFX and (Gradle to fetch my dependencies).

Here is a setup of my build.gradle file

plugins {
    id 'java'
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.7'
    id 'org.beryx.jlink' version '2.14.0'
}

group 'com.databox'
version '1'

mainClassName = "com.databox.launcher.ApplicationLoader"
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testImplementation group: 'junit', name: 'junit', version: '4.12'
    implementation group: 'org.iq80.leveldb', name: 'leveldb', version: '0.12'
    implementation group: 'org.json', name: 'json', version: '20180813'
}

javafx {
    version = "12.0.1"
    modules = ['javafx.base', 'javafx.fxml', 'javafx.controls', 'javafx.web']
}

jlink {
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher{
        name = 'DataBox'
        jvmArgs = ['-Dlog4j.configurationFile=./log4j2.xml']
    }
}

Now I am done with the application and need to package it as an executable file for the Windows platform. To do that I did gradlew jlink but I keep getting

 >Task :createMergedModule
C:\user_home\DataBox\build\jlinkbase\tmpjars\com.databox.merged.module\module-info.java:27: error: PatternCompiler is not public in com.google.commo
n.base; cannot be accessed from outside package
    uses com.google.common.base.PatternCompiler;
                               ^
1 error

> Task :createMergedModule FAILED

FAILURE: Build failed with an Exception

However, I am not using anything related to Guava.

Thanks once again.

pcmind commented 5 years ago

Your failure has nothing to do with leveldb. You need to fix your project package usage/modue-info.java.