Skip to content

scala.Tuple2 doesn't exist #14

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

Closed
lopezavila85 opened this issue Jan 4, 2016 · 5 comments
Closed

scala.Tuple2 doesn't exist #14

lopezavila85 opened this issue Jan 4, 2016 · 5 comments

Comments

@lopezavila85
Copy link

Hello,

I have downloaded the code examples, SBT 0.13.9 and Scala 2.11.6. Both of them have been installed separately in a Windows 10 machine. After downloading the dependencies, which seem to be correct I get these errors:

C:\home\aall\projects\scala-examples>sbt test
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from C:\home\aall\projects\scala-examples\project
[info] Set current project to Programming Scala, Second Edition - Code examples (in build file:/C:/home/aall/projects/scala-examples/)
[info] Compiling 70 Scala sources and 4 Java sources to C:\home\aall\projects\scala-examples\target\scala-2.11\classes...
[error] C:\home\aall\projects\scala-examples\src\main\java\progscala2\javainterop\ScalaTuples.java:3: error: package scala does not exist
[error] import scala.Tuple2;
[error]             ^
[error] C:\home\aall\projects\scala-examples\src\main\java\progscala2\javainterop\ScalaTuples.java:7: error: cannot find symbol
[error]     Tuple2<String,Integer> stringInteger = new Tuple2<String,Integer>("one", 2);
[error]     ^
[error]   symbol:   class Tuple2
[error]   location: class ScalaTuples
[error] C:\home\aall\projects\scala-examples\src\main\java\progscala2\javainterop\ScalaTuples.java:7: error: cannot find symbol
[error]     Tuple2<String,Integer> stringInteger = new Tuple2<String,Integer>("one", 2);
[error]                                                ^
[error]   symbol:   class Tuple2
[error]   location: class ScalaTuples
[error] 3 errors
[error] (compile:compile) javac returned nonzero exit code
[error] Total time: 16 s, completed 04-ene-2016 23:15:37

It cannot find scala.Tuple2 class... At least in the latest API docs (Scala 2.11.7) the class appears:

http://www.scala-lang.org/api/current/index.html#scala.Tuple2

After this, I uninstalled the separated Scala package and removed .sbt and .ivy2 in my Windows home directory. Furthermore, I rebooted the system and executed sbt test again...the result was the same.

Maybe I have a problem with my home folder: C:\Users\Álvaro\.ivy2 (note the Á)
What can I do?

Thanks in advance.

@deanwampler
Copy link
Owner

I successfully ran a clean build on Windows 8 (in VMWare, full disclosure...). Your issue probably indicates a corrupt %HOME%/.ivy2/ repo (where the downloaded dependencies go ... to die?? ;) This can happen if the Maven .pom files are there, but not the .jar files, for some reason.

You could try deleting the whole %HOME%/.ivy2/ directory, but it will force downloading all dependencies again, including for any other project you have that uses a build tool like SBT that uses Ivy2 for dependencies. You might first try deleting %HOME%/.ivy2/cache/org.scala-lang and see if that's enough.

@lopezavila85
Copy link
Author

Hello Dean,

I have removed just that folder, but the problem is not resolved.

In some of the folders, some older jars are appearing, is it ok? For instance, in scala-library\jars I have stored two versions:

scala-library-2.10.4.jar `` scala-library-2.11.6.jar

The same is happening in other folders, and in jline and scalap I haven't the correspoding 2.11.6 version...maybe the dependencies are not resolved correctly at all.

Any idea? Thanks.

@deanwampler
Copy link
Owner

deanwampler commented Jan 5, 2016 via email

@lopezavila85
Copy link
Author

Your latest update made it possible (Scala 2.11.7 dependencies) !!! I removed again the '.ivy2' and '.sbt' folders under my home folder:

[info] Passed: Total 37, Failed 0, Errors 0, Passed 37
[success] Total time: 263 s, completed 07-ene-2016 22:49:14

Thank you so much ;)

@deanwampler
Copy link
Owner

Glad you got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants