Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class scala.StringBuilder missing in the 2.8.1 downloads #4113

Closed
scabug opened this issue Dec 26, 2010 · 6 comments
Closed

Class scala.StringBuilder missing in the 2.8.1 downloads #4113

scabug opened this issue Dec 26, 2010 · 6 comments
Labels

Comments

@scabug
Copy link

scabug commented Dec 26, 2010

=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===

  code goes here

I downloaded scala 2.8.1 from the download page.
On a code where I do string1 + string2 an exception is thrown: java.lang.NoClassDefFoundError: scala/StringBuilder

=== What is the expected behavior? ===
The exception should not be thrown.

=== What do you see instead? ===
Exception thrown is unexpected.

=== Additional information ===
(for instance, a link to a relevant mailing list discussion)
I checked that the jar scala-library.jar does not contain the relevant class file. (I could find this class in 2.7.7 build that came with Eclipse plugin.)

Attaching scala-library.jar along with.

=== What versions of the following are you using? ===

  • Scala: 2.8.1 lzpack installer and tgz both
  • Java:
  • Operating system:
@scabug
Copy link
Author

scabug commented Dec 26, 2010

Imported From: https://issues.scala-lang.org/browse/SI-4113?orig=1
Reporter: Ashish Belagali (ab)

@scabug
Copy link
Author

scabug commented Dec 26, 2010

@paulp said:
Recompile your code against 2.8.1.

@scabug
Copy link
Author

scabug commented Dec 26, 2010

Ashish Belagali (ab) said:
It still does not work against 2.8.1 while it works against 2.7.7.

$$ jar -tvf /home/ashish/prg/scala/lib/scala-library.jar | grep StringBuilder
70611 Tue Nov 09 14:47:18 IST 2010 scala/collection/mutable/StringBuilder.class

This makes me believe that the class was moved to another package. However, even after I import the class from its new location, the + function still seems to expect to find it in the scala package, and gives error.

Am I missing something here?

@scabug
Copy link
Author

scabug commented Dec 26, 2010

@ijuma said:
You are likely compiling with 2.7.7 even though you don't realise it. A lot of us have been using 2.8.1 for a while and we have code like you describe in a lot of places.

@scabug
Copy link
Author

scabug commented Dec 26, 2010

Ashish Belagali (ab) said:
Yes, it's truly surprising. I have a simple ant buildfile where I set scala.home to whichever version that I require, and the results are consistent from cmd line and from Eclipse; namely that it works correctly with 2.7.7 and it does not work with 2.8.1. (That rules out the possibility of accidentally using a different version.)

If I were incorrectly compiling with 2.7.7 as you say then I would not have come across the error in the first place.

As I had said before, the class is seen packaged in different folders in 2.8.1 version and in 2.7.7 version. Please consider the following:

$$ /home/ashish/prg/scala/bin/scala -version
Scala code runner version 2.8.1.final -- Copyright 2002-2010, LAMP/EPFL
$$ jar -tvf /home/ashish/prg/scala/lib/scala-library.jar | grep StringBuilder
70611 Tue Nov 09 14:47:18 IST 2010 scala/collection/mutable/StringBuilder.class

// The one below is 2.7.7 in Eclipse plugin
$$ jar -tvf /home/ashish/prg/eclipse/configuration/org.eclipse.osgi/bundles/590/1/.cp/lib/scala-library.jar | grep StringBuilder
932 Wed Oct 28 13:59:48 IST 2009 scala/StringBuilder$$$$anon$$1.class
3438 Wed Oct 28 13:59:44 IST 2009 scala/StringBuilder$$.class
15141 Wed Oct 28 13:59:50 IST 2009 scala/StringBuilder.class
21624 Wed Oct 28 13:59:42 IST 2009 scala/runtime/RichStringBuilder.class

Hope this helps.

@scabug
Copy link
Author

scabug commented Dec 26, 2010

@paulp said:
Look, you're compiling against something else. scala.StringBuilder is a type alias in 2.8.1. Somehow thousands of other projects use 2.8.1 just fine, and the error you're seeing points directly at the issue, which I already told you. Please don't reopen this ticket.

@scabug scabug closed this as completed May 18, 2011
@scabug scabug added the build label Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant