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

Running first example in the book fails #3

Open
ivan-brko opened this issue Jan 29, 2021 · 1 comment
Open

Running first example in the book fails #3

ivan-brko opened this issue Jan 29, 2021 · 1 comment

Comments

@ivan-brko
Copy link

On a system with nothing Scala/sbt specific installed, running java --version gives the following:

openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10, mixed mode, sharing)

Running the first example results in following:

./sbt.sh 
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Getting org.scala-sbt sbt 0.13.11 ...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ivy.util.url.IvyAuthenticator (file:/home/ivan/Projects/Play/essential-play-code/chapter1-hello/sbt-launch.jar) to field java.net.Authenticator.theAuthenticator
WARNING: Please consider reporting this to the maintainers of org.apache.ivy.util.url.IvyAuthenticator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

:: problems summary ::
:::: WARNINGS
                module not found: org.scala-sbt#sbt;0.13.11

        ==== local: tried

          /home/ivan/.ivy2/local/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml

          -- artifact org.scala-sbt#sbt;0.13.11!sbt.jar:

          /home/ivan/.ivy2/local/org.scala-sbt/sbt/0.13.11/jars/sbt.jar

        ==== typesafe-ivy-releases: tried

          http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml

        ==== Maven Central: tried

          http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.11/sbt-0.13.11.pom

          -- artifact org.scala-sbt#sbt;0.13.11!sbt.jar:

          http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.11/sbt-0.13.11.jar

                ::::::::::::::::::::::::::::::::::::::::::::::

                ::          UNRESOLVED DEPENDENCIES         ::

                ::::::::::::::::::::::::::::::::::::::::::::::

                :: org.scala-sbt#sbt;0.13.11: not found

                ::::::::::::::::::::::::::::::::::::::::::::::


:::: ERRORS
        Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml

        SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.11/sbt-0.13.11.pom

        SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.11/sbt-0.13.11.jar


:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.11: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/ivan/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.11

@blue-tachikoma
Copy link

blue-tachikoma commented Mar 30, 2021

Fixed it by going inside sbt-launch.jar and changing in properties files "http" to "https" + adding an https route for maven central. Or you can just download scala and sbt by yourself, change versions in each project configuration files and it will probably work fine.

Files changed inside sbt-launch.jar:

sbt/sbt.boot.properties
sbt.boot.properties0.7
sbt.boot.properties0.10.0
sbt.boot.properties0.10.1
sbt.boot.properties0.11.0
sbt.boot.properties0.11.1
sbt.boot.properties0.11.2
sbt.boot.properties0.11.3

How to change?
Use winrar, 7zip or other archive manager to open jar (NOT EXTRACTING), modify files in text editor and save (it will probably ask "update archive?", just say yes).

What to change?

  • If you see http change it to https
    Expample:
    given string: typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/,[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
    changed: typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]

  • if you see maven-central add https route for it
    Expample:
    given string: maven-central
    changed: maven-central: https://repo1.maven.org/maven2

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