I am getting an error saying I have a file that is too long in sbt.
[info] Compiling 29 Scala sources to /home/chris/dev/suredbits-core/target/scala-2.11/classes...
[error] File name too long
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 7 s, completed Feb 17, 2015 8:10:25 AM
How do I find out which file is too long so I can shorten the filename? I have added the compiler flag -Xmax-classfile-name
and set it to 254.
If your /home
is an encrypted file system (e.g. LUKS), you might run into this issue.
Setting max-classfile-name
to 254 is the default (or it might be 255) - so you're not reducing it much. You should probably be considering something closer to a max length of 70 - 100. You can set it for all your projects by creating ~/.sbt/0.13/local.sbt
with the scalac override:
scalacOptions ++= Seq("-Xmax-classfile-name","78")
This is how I solved my problem
mkdir /tmp/myproject-target
cd ~/workspace/myproject
rm -rf target
ln -s /tmp/myproject-target target
I encountered this problem in IntelliJ Ultimate 2016.1.2 (which resembles Intellij 14). I solved it by setting:
-Xmax-classfile-name 78
In File > Settings... > Build, Execution, Deployment > Compiler > Scala Compiler > Additional Compiler Options.
NOTE: there is a space between the option name and its value ("78"), not an equals sign.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With