Closed tokman2 closed 5 years ago
Well turned out that I unzipped the jar file and it doesn't contain any dependencies how can I make sure that the jar contains my dependencies too?
I figured it out, just need to add the following code inside the build gradle file.
jar { manifest { attributes( 'Class-Path': configurations.compileClasspath.files.collect {"$it.name"}.join(' '), 'Main-Class': 'com.testpackage.Main' ) } from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } }
The application hangs with the following error when okhttp3.Credentials.basic() method gets called:
I went line by line and commented out everything this line causes the issue:
String authToken = Credentials.basic(username, password);
I don't know what to do, any further help is appreciated. I'm using 64bit java8 sdk on a 64 bit macOS High Sierra v10.13.3 and Retrofit 2.4 with gson 2.4 converter and gradle 4.4. The code is basic hello world javafx app with one button that should call a http get and convert the json answer into an object. For this I'm using retrofit2 and that library contains okhttp3. I've done this many times on android and linux/windows this is nothing new to me. The application works in the IDE (I'm using latest intellij ultimate) and from command line via gradle run.