3

When I run sbt update i get this error

    :: problems summary ::
:::: WARNINGS
        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

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

        :: org.scala-sbt#sbt;0.13.8: several problems occurred while resolving dependency: org.scala-sbt#sbt;0.13.8 {default=[default(compile)]}:
    java.util.NoSuchElementException
    java.util.NoSuchElementException

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



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.8: several problems occurred while resolving dependency: org.scala-sbt#sbt;0.13.8 {default=[default(compile)]}:
    java.util.NoSuchElementException
    java.util.NoSuchElementException
Error during sbt execution: Error retrieving required libraries
  (see /Users/$USER/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.8

I've already set up the system to work with curl and homebrew using a proxy, but for some reason sbt won't work with the same settings. When I turn the proxy off, It just hangs for a few minutes before timing out and I don't get the aforementioned error.

I've also tried this, but without any luck

# export JAVA_FLAGS= -Dhttp.proxyHost=$domain -Dhttp.proxyPort=$portnum -Dhttp.proxyUser=$USER -Dhttp.proxyPassword=$password -Dhttps.proxyHost=$domain -Dhttps.proxyPort=$portnum -Dhttps.proxyUser=$USER -Dhttps.proxyPassword=$password -Dftp.proxyHost=$domain -Dftp.proxyPort=$portnum -Dftp.proxyUser=$USER -Dftp.proxyPassword=$password -Dhttp.nonProxyHosts=$noproxy -Dhttps.nonProxyHosts=$noproxy -Dftp.nonProxyHosts=$noproxy
    # java ${JAVA_FLAGS}

The method I used to make hombrew and curl work is

export http_proxy=$http_proxy
    export https_proxy=$http_proxy
    export ftp_proxy=$http_proxy
    export rsync_proxy=$http_proxy
    export HTTP_PROXY=$http_proxy
    export HTTPS_PROXY=$http_proxy
    export FTP_PROXY=$http_proxy
    export RSYNC_PROXY=$http_proxy

Any suggestions?

Thanks

Narwhal
  • 325
  • 3
  • 15
  • check this link - http://stackoverflow.com/questions/13803459/how-to-use-sbt-from-behind-proxy – royki Aug 04 '15 at 20:01
  • I've actually tried that before. I switched it to JAVA_FLAGS afterwards to try something else. Lemme know if you need to know something else. – Narwhal Aug 04 '15 at 20:25

1 Answers1

0

I am not sure whether your JAVA_FLAGS included/exported to classpath or not, if not add it to classpath before trying this solution.

My Resoultion: I don't know which IDE you are using, I faced same issue (I use IntelliJ 14). Try to relate to your IDE if you use different one, basically set it through VM arguments.

I have resolved this issue by adding vm arguments ...

Steps to add in IntelliJ:

File -> Default Settings -> under Build,Execution, Deployment

Build Tools -> SBT ->

JVM Options -> set in the "VM parameters" like this

-Dhttp.proxyHost=http://proxy.xxxx.com -Dhttp.proxyPort=8080 -Dhttps.proxyHost=http://proxy.xxx.com -Dhttps.proxyPort=8080 -XX:MaxPermSize=384M -Duser.home=/Users/yourusername/ -Dsbt.ivy.home=/Users/yourusername/.ivy2

Good Luck

Ashok Gudise
  • 79
  • 1
  • 7
  • I have the same problem. I'm stuck behind a proxy. Setting up git, pip and conda to work is no problem, but sbt just won't work with it, no matter which `-Dkey=value` i use for the proxy. – Nima Mousavi May 30 '18 at 06:12