Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
846 views
in Technique[技术] by (71.8m points)

scala - Filename too long sbt

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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")

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...