Android Question Compile error – truncated classpath? Library path list cut off at beginning

fredo

Well-Known Member
Licensed User
Longtime User
I'm getting a compile error on a long-standing project that was working fine until recently.

The error message shows a list of library JAR paths, but notably the list appears truncated at the beginning - it starts with: ywhere Software\B4A\libraries\network.jar instead of Anywhere Software\..., suggesting the full classpath string is being cut off.
[IDE message - 7:23:42]
An error occurred.
ywhere Software\B4A\libraries\network.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\okhttp.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\phone.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\randomaccessfile.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\reflection.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\runtimepermissions.androidx.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\sql.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\tabstripviewpager.jar"
;"D:\dev\B4A_LibrariesExtra\b4a\touchimageview.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\viewsex.jar"
;"D:\dev\B4A_LibrariesExtra\b4a\webviewxtended.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\xcustomlistview.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\xui.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\javaobject.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\okhttp-4.9.0.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\okio-2.8.0.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\okhttp-urlconnection-4.9.3.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\stringutils.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\bitmapcreator.jar"
;"D:\dev\B4A_LibrariesExtra\b4a\detector.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\annotation\annotation\1.9.1\annotation-1.9.1.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\annotation\annotation-jvm\1.9.1\annotation-jvm-1.9.1.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\org.jetbrains.kotlin-kotlin-stdlib.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\org.jetbrains.kotlinx-kotlinx-coroutines-android.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\lifecycle\lifecycle-common\2.9.1\lifecycle-common-2.9.1.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\lifecycle\lifecycle-common-jvm\2.9.1\lifecycle-common-jvm-2.9.1.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\org.jetbrains.kotlinx-kotlinx-coroutines-core-jvm.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\arch\core\core-common\2.2.0\core-common-2.2.0.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\collection\collection\1.5.0\collection-1.5.0.jar"
;"c:\android\tools\..\extras\b4a_remote\androidx\collection\collection-jvm\1.5.0\collection-jvm-1.5.0.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\com.google.guava-listenablefuture.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\com.google.guava-guava.jar"
;"c:\android\tools\..\extras\b4a_remote\com\google\firebase\firebase-annotations\16.2.0\firebase-annotations-16.2.0.jar"
;"C:\Program Files\Anywhere Software\B4A\libraries\javax.inject-javax.inject.jar"
;"c:\android\tools\..\extras\b4a_remote\com\google\firebase\firebase-encoders\17.0.0\firebase-encoders-17.0.0.jar"
;"c:\android\tools\..\extras\b4a_remote\com\google\firebase\firebase-encoders-proto\16.0.0\firebase-encoders-proto-16.0.0.jar"
;
;bin\classes\ @arguments.txt
javac 19.0.2

What I've tried / observed:
  • Fresh B4A reinstall --> same error
  • A different project B compiles without issues
  • Even an older version of project A shows the same problem
So it seems project-specific but not tied to my recent changes.

Has anyone seen this before?

My guess is the combined classpath for this project exceeds some OS or JDK character limit.

Any pointers on where to start looking would be appreciated - perhaps too many libraries checked, or the project path being too long?
 

zed

Well-Known Member
Licensed User
You're most likely on the right track with the hypothesis of an excessively long classpath.

This symptom is typical of a line length limit in the javac command.
On Windows, the limit is approximately 32,768 characters for a complete command line.
When B4A generates the javac command with a very long list of JARs, the beginning of the line can be truncated.

Why does this happen on this project but not another?

Because each B4A project generates a different classpath depending on the libraries selected in the library manager. Your project A must have enough JARs to exceed the limit, while project B remains below it.
You can check the total length of the javac line in the log. If it exceeds ~30,000 characters, you've found the cause.
 
Upvote 0
Top