Java Question Javadoc generation - "The command line is too long" error

Andrew (Digitwell)

Active Member
Licensed User
I am using Android Studio to create a library using FirebaseAdmin to log into Firebase and access the Storage for B4J.

I have created libraries before and they work fine.

However, as soon as I add "implementation 'com.google.firebase:firebase-admin:6.8.1'" to the maven file.

on the Javadoc generation step I get the following error:

"The command line is too long."

E:\artkx\AndroidStudioProjects\DigitwellFS\DigitwellFirestore\src\B4AtoXML.bat "E:\Development\Android\Android Studio1\jre" E:\artkx\AndroidStudioProjects\DigitwellFS\DigitwellFirestore uk.co.digitwell.DigitwellFirestore "E:\Development\Android\Android Studio1\jre\jre\lib\charsets.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\access-bridge-64.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\cldrdata.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\dnsns.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\jaccess.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\localedata.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\nashorn.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\sunec.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\sunjce_provider.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\sunmscapi.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\sunpkcs11.jar;E:\Development\Android\Android Studio1\jre\jre\lib\ext\zipfs.jar;E:\Development\Android\Android Studio1\jre\jre\lib\jce.jar;E:\Development\Android\Android Studio1\jre\jre\lib\jsse.jar;E:\Development\Android\Android Studio1\jre\jre\lib\management-agent.jar;E:\Development\Android\Android Studio1\jre\jre\lib\resources.jar;E:\Development\Android\Android Studio1\jre\jre\lib\rt.jar;E:\Development\Android\platforms\android-28\android.jar;E:\Development\Android\platforms\android-28\data\res;E:\artkx\AndroidStudioProjects\DigitwellFS\DigitwellFirestore\build\generated\res\rs\debug;E:\.gradle\caches\modules-2\files-2.1\com.google.cloud\google-cloud-core-grpc\1.43.0\58b4839ab48c06592f738ddd156ef81ecd19bd84\google-cloud-core-grpc-1.43.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.errorprone\error_prone_annotations\2.1.2\6dcc08f90f678ac33e5ef78c3c752b6f59e63e0c\error_prone_annotations-2.1.2.jar;E:\.gradle\caches\modules-2\files-2.1\io.opencensus\opencensus-api\0.15.0\9a098392b287d7924660837f4eba0ce252013683\opencensus-api-0.15.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.opencensus\opencensus-contrib-grpc-metrics\0.12.3\a4c7ff238a91b901c8b459889b6d0d7a9d889b4d\opencensus-contrib-grpc-metrics-0.12.3.jar;E:\.gradle\caches\modules-2\files-2.1\commons-codec\commons-codec\1.10\4b95f4897fa13f2cd904aee711aeafc0c5295cd8\commons-codec-1.10.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.firebase\firebase-admin\6.8.1\ffd7e5352421639a249018cc5413b2796009a2e4\firebase-admin-6.8.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.apis\google-api-services-storage\v1-rev135-1.24.1\28d3d391dfc7e7e7951760708ad2f48cecacf38f\google-api-services-storage-v1-rev135-1.24.1.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-stub\1.13.1\2fc6e85e459ac522a3d81a78add8b6695f7525f1\grpc-stub-1.13.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.7\751f548c85fa49f330cecbb1875893f971b33c4e\gson-2.7.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.http-client\google-http-client-jackson2\1.25.0\7c5c89bd4d0d34d9f1cb3396e8da6233e5074b5c\google-http-client-jackson2-1.25.0.jar;E:\.gradle\caches\modules-2\files-2.1\org.codehaus.jackson\jackson-core-asl\1.9.11\e32303ef8bd18a5c9272780d49b81c95e05ddf43\jackson-core-asl-1.9.11.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-resolver\4.1.22.Final\b5484d17a97cb57b07d2a1ac092c249e47234c17\netty-resolver-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-netty-shaded\1.13.1\ccdc4f2c2791d93164c574fbfb90d614aa0849ae\grpc-netty-shaded-1.13.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api\gax\1.30.0\58fa2feb11b092be0a6ebe705a28736f12374230\gax-1.30.0.jar;E:\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpclient\4.5.5\1603dfd56ebcd583ccdf337b6c3984ac55d89e58\httpclient-4.5.5.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-core\1.13.1\74f5300e1e4d5c2abc0e4fc927d24f4f593c5a7d\grpc-core-1.13.1.jar;E:\.gradle\caches\modules-2\files-2.1\commons-logging\commons-logging\1.2\4bfc12adfe4842bf07b657f0369c4cb522955686\commons-logging-1.2.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api.grpc\proto-google-common-protos\1.12.0\1140cc74df039deb044ed0e320035e674dc13062\proto-google-common-protos-1.12.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-handler\4.1.22.Final\a3a16b17d5a5ed6f784b0daba95e28d940356109\netty-handler-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-common\4.1.22.Final\56ff4deca53fc791ed59ac2b72eb6718714a4de9\netty-common-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\io.opencensus\opencensus-contrib-http-util\0.15.0\d88690591669d9b5ba6d91d9eac7736e58ccf3da\opencensus-contrib-http-util-0.15.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api.grpc\proto-google-iam-v1\0.12.0\ea312c0250a5d0a7cdd1b20bc2c3259938b79855\proto-google-iam-v1-0.12.0.jar;E:\.gradle\caches\modules-2\files-2.1\org.threeten\threetenbp\1.3.3\3ea31c96676ff12ab56be0b1af6fff61d1a4f1f2\threetenbp-1.3.3.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.j2objc\j2objc-annotations\1.1\ed28ded51a8b1c6b112568def5f4b455e6809019\j2objc-annotations-1.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.http-client\google-http-client\1.25.0\5fb16523c393bfe0210c29db44742bd308311841\google-http-client-1.25.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api\api-common\1.7.0\ea59fb8b2450999345035dec8a6f472543391766\api-common-1.7.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.guava\guava\20.0\89507701249388e1ed5ddcf8c41f4ce1be7831ef\guava-20.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api-client\google-api-client\1.25.0\e7ff725e89ff5dcbed107be1a24e8102ae2441ee\google-api-client-1.25.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-context\1.13.1\e8d8407217ffe43996700f667fa1f6bee0a8c19a\grpc-context-1.13.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.cloud\google-cloud-firestore\0.61.0-beta\57925e99afbe7a7155523ea6e74cbd7081257c59\google-cloud-firestore-0.61.0-beta.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec\4.1.22.Final\239c0af275952e70bb4adf7cf8c03d88ddc394c9\netty-codec-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\joda-time\joda-time\2.9.2\36d6e77a419cb455e6fd5909f6f96b168e21e9d0\joda-time-2.9.2.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\jsr305\3.0.2\25ea2e8b0c338a877313bd4672d3fe056ea78f0d\jsr305-3.0.2.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.http-client\google-http-client-gson\1.25.0\b73df76fb315b1cc8be1a26240954bde40c26109\google-http-client-gson-1.25.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.oauth-client\google-oauth-client\1.25.0\c9ee14e8b095b4b301b28d57755cc482b8d6f39f\google-oauth-client-1.25.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api\gax-grpc\1.30.0\ada82a4a0c020807e1c1a674b18658374264e401\gax-grpc-1.30.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api-client\google-api-client-gson\1.25.0\57c2625fcd249024b931f31f7719826f4b46a538\google-api-client-gson-1.25.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.http-client\google-http-client-jackson\1.24.1\2c88e77c14effdda76f02a0eac968de74e0bd4e\google-http-client-jackson-1.24.1.jar;E:\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.25\da76ca59f6a57ee3102f8f9bd9cee742973efa8a\slf4j-api-1.7.25.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.http-client\google-http-client-appengine\1.24.1\8535031ae10bf6a196e68f25e10c0d6382699cb6\google-http-client-appengine-1.24.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.cloud\google-cloud-core\1.43.0\a28eb94f2410e20ae5b663e943b8465078a4bc02\google-cloud-core-1.43.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-transport\4.1.22.Final\3bd455cd9e5e5fb2e08fd9cd0acfa54c079ca989\netty-transport-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-protobuf\1.13.1\832f531a79249af2d9c1d50168301ba2bc45b54b\grpc-protobuf-1.13.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-java-util\3.6.0\3680d0042d4fe0b95ada844ff24da0698a7f0773\protobuf-java-util-3.6.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-auth\1.13.1\96327e5774b7e0ed7f47043af9ff4fbc7f00f36\grpc-auth-1.13.1.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.cloud\google-cloud-core-http\1.43.0\a81185d18d017f68b14e4f5f1047b4e8f4709632\google-cloud-core-http-1.43.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.9.6\4e393793c37c77e042ccc7be5a914ae39251b365\jackson-core-2.9.6.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api\gax-httpjson\0.47.0\d096f3142eb3adbf877588d1044895d148d9efcb\gax-httpjson-0.47.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.api.grpc\proto-google-cloud-firestore-v1beta1\0.26.0\69030565c34affbbcee0df2a79e0a9d97692320a\proto-google-cloud-firestore-v1beta1-0.26.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.auth\google-auth-library-oauth2-http\0.11.0\576d6ae74c10e6a0d3f30a97ef59499473b02175\google-auth-library-oauth2-http-0.11.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec-http\4.1.22.Final\3805f3ca0d57630200defc7f9bb6ed3382dcb10b\netty-codec-http-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.cloud\google-cloud-storage\1.43.0\6358bbf7a173027274aacc65789dd46c06451539\google-cloud-storage-1.43.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.auto.value\auto-value\1.4\6d1448fcd13074bd3658ef915022410b7c48343b\auto-value-1.4.jar;E:\.gradle\caches\modules-2\files-2.1\io.netty\netty-buffer\4.1.22.Final\15e964a2095031364f534a6e21977f5ee9ca32a9\netty-buffer-4.1.22.Final.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-java\3.6.0\5333f7e422744d76840c08a106e28e519fbe3acd\protobuf-java-3.6.0.jar;E:\.gradle\caches\modules-2\files-2.1\com.google.auth\google-auth-library-credentials\0.11.0\75f79364e9d4977c6462446fcccf83d2f6eeb69f\google-auth-library-credentials-0.11.0.jar;E:\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.4.9\a86ce739e5a7175b4b234c290a00a5fdb80957a0\httpcore-4.4.9.jar;E:\.gradle\caches\modules-2\files-2.1\io.opencensus\opencensus-contrib-grpc-util\0.15.0\bd86852303d3e4610ef44c007a6e3a728d95568f\opencensus-contrib-grpc-util-0.15.0.jar;E:\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-protobuf-lite\1.13.1\6ca13585100ad99e1c6140a7c8138dd96596aaf5\grpc-protobuf-lite-1.13.1.jar" E:\artkx\AndroidStudioProjects\DigitwellFS\DigitwellFirestore\build\B4Alibs\DigitwellFirestore.xml
The command line is too long.

Process finished with exit code 1

It seems that the generated ClassPath make to the command line too long.

Is there another way to create the XML file or make the command line shorter.

Thanks
 

Andrew (Digitwell)

Active Member
Licensed User
Yes, I am trying to build a library for B4J so Java only.

Are you saying that I should only use Eclipse to build this library?
 

DonManfred

Expert
Licensed User
I built it with gradle and used shadow to build a fat jar file as there were way too many dependent jars to work out manually.
I would like to learn more about this. Can you show an example-project or explain how to setup this?
 

Andrew (Digitwell)

Active Member
Licensed User
sure.
Create a new Gradle Project in Eclipse.

It automatically creates a Library.java and also some test classes.
I deleted the src/test/java and src/main/resources.
I deleted Library.java and created my own package MyB4jFeatures

I then Added Core.jar and B4AShared.jar from the Basic4Android/Libraries directory to the Build Path as External Jars. (Should this be jCore.jar instead)

I then updated Build.gradle

This is my complete file.
B4X:
/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Java Library project to get you started.
 * For more details take a look at the Java Libraries chapter in the Gradle
 * user guide available at https://docs.gradle.org/5.0/userguide/java_library_plugin.html
 */

plugins {
// This Allows the ShadowJar creation
    id 'com.github.johnrengelman.shadow' version '5.0.0'
// I think you can get away with just java-library
    id 'java'
    id 'java-library'
    id 'eclipse'
//I'm not sure you need the war file.
    id 'war'
  
}


repositories {
    // Use jcenter for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
   // I needed this for the project I was wrapping, can be optional
    google()
    mavenCentral()
    jcenter()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // This dependency is exported to consumers, that is to say found on their compile classpath.
    api 'org.apache.commons:commons-math3:3.6.1'

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation 'com.google.guava:guava:26.0-jre'

    //This is the library I am using/wrapping, you would place your own items here.
   implementation 'com.google.firebase:firebase-admin:6.8.1'

  
}
You need to Refresh the Gradle Project after these changes.
Right Click on Project Name Gradle->Refresh Gradle Project

I also had to close and reopen eclipse before the Shadow Gradle options appeared.

Under Gradle Tasks You should now see some new options:
upload_2019-6-8_18-0-13.png


To build the Fat Jar, you need to run the shadowJar task.
More information on the Shadow Jar Gradle task can be foound here: https://imperceptiblethoughts.com/shadow/introduction/

Then write your Java code as normal.
I created the Javadoc using the guide Erel provided.

This creates a *-all.jar file in build/lib directory.

Hope that helps.
 

DonManfred

Expert
Licensed User

Andrew (Digitwell)

Active Member
Licensed User
COOL!

I now have a FirebaseAdmin-all.jar with a size of 25mb and i can see a lot of dependecies in the project.

Need to play with this setup now...
Yes, I'm sure that the setup can be optimised. I'd like to get gradle create the XML file and copy everything to the same directory. let me know how you get on.
 

DonManfred

Expert
Licensed User
I'd like to get gradle create the XML file
i dont know how cradle can create the xml file needed for B4A/J.
I always compile with SLC. I do it the same with this setup.

As of now i am trying to implement my Firestore code which i am using for b4a to adapt them for firestore admin...
 

DonManfred

Expert
Licensed User
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Build credentials...
credentials build...
InitApp
InitAuth
InitDatabase
InitFirestore
Init Messaging
(ArrayList) [com.google.cloud.firestore.QueryDocumentSnapshot@933e70c4, com.google.cloud.firestore.QueryDocumentSnapshot@e70b7501]
Query DocumentNo: #0: KP4jH5pjjD8ESXTzl7ge
(MyMap) {price=1.25, Driver=DocumentReference{path=projects/gcmb4a/databases/(default)/documents/Drivers/u8gkB2lhRRMG5jLW5F6D}, category=Taxi, numberPlate=MSY1912, Name=Mannes Headquarter, Location=GeoPoint { latitude=50.833598, longitude=6.4411892 }}
Query DocumentNo: #1: pkr9o5KvxmS09ApT08mR
(MyMap) {NumberPlate=MyPlate, Driver=DocumentReference{path=projects/gcmb4a/databases/(default)/documents/Drivers/ceGC7eI8RM17dP0eSyZZ}, category=Taxi, prize=1.8, Name=Somename, Location=GeoPoint { latitude=50.833598, longitude=6.4411892 }}
Looks good so far. As of now just do some basic tests.
 
Top