Install SBT on Linux - scala

I am trying to install SBT for scala developing. I follow the guid in Installing sbt manually
The errors show as follows
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;0.13.7
==== local: tried
/home/nan/.ivy2/local/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml
-- artifact org.scala-sbt#sbt;0.13.7!sbt.jar:
/home/nan/.ivy2/local/org.scala-sbt/sbt/0.13.7/jars/sbt.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.pom
-- artifact org.scala-sbt#sbt;0.13.7!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.7: not found
::::::::::::::::::::::::::::::::::::::::::::
:::::: ERRORS
Server access Error: Connection refused url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml
Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.pom
Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.7: not found
Error during sbt execution: Error retrieving required libraries (see /home/nan/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.7
The link "https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar" cannot be accessed even in the browser. Are there any solutions?

As the commenter said, it looks like you are just having a network connection problem.
However, if you are not using a package manager, I recommend to use the "sbt-extras" script from here. I.e.
curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt \
> ~/bin/sbt && chmod 0755 ~/bin/sbt

Related

unable to run sbt in my windows 10 -64

am getting below error when i run sbt in my command prompt
The filename, directory name, or volume label syntax is incorrect.
FINDSTR: Cannot open C:\Users\vinoli\AppData\Local\Temp;C:\Program Files (x86)\sbt\bin\out.txt
FINDSTR: Cannot open C:\Users\vinoli\AppData\Local\Temp;C:\Program Files (x86)\sbt\bin\out.txt
FINDSTR: Cannot open C:\Users\vinoli\AppData\Local\Temp;C:\Program Files (x86)\sbt\bin\out.txt
FINDSTR: Cannot open C:\Users\vinoli\AppData\Local\Temp;C:\Program Files (x86)\sbt\bin\out.txt
FINDSTR: Cannot open C:\Users\vinoli\AppData\Local\Temp;C:\Program Files (x86)\sbt\bin\out.txt
The java installation you have is not up to date
sbt requires at least version 1.6+, you have
version 0
Please go to http://www.java.com/getjava/ and download
a valid Java Runtime and install before running sbt.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Getting org.scala-sbt sbt 0.13.15 (this may take some time)...
downloading https://repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.0.1/launcher-interface-1.0.1.jar ...
downloading https://repo1.maven.org/maven2/org/scala-sbt/template-resolver/0.1/template-resolver-0.1.jar ...
:: problems summary ::
:::: WARNINGS
[FAILED ] org.scala-sbt#launcher-interface;1.0.1!launcher-interface.jar: The filename, directory name, or volume label syntax is incorrect (3358ms)
[FAILED ] org.scala-sbt#launcher-interface;1.0.1!launcher-interface.jar: (0ms)
==== local: tried
C:\Users\vinoli\.ivy2\local\org.scala-sbt\launcher-interface\1.0.1\jars\launcher-interface.jar
==== local-preloaded-ivy: tried
file:/C:/Users/vinoli/.sbt/preloaded/org.scala-sbt/launcher-interface/1.0.1/jars/launcher-interface.jar
==== local-preloaded: tried
file:/C:/Users/vinoli/.sbt/preloaded/org/scala-sbt/launcher-interface/1.0.1/launcher-interface-1.0.1.jar
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.0.1/launcher-interface-1.0.1.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/launcher-interface/1.0.1/jars/launcher-interface.jar
==== sbt-ivy-snapshots: tried
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/launcher-interface/1.0.1/jars/launcher-interface.jar
[FAILED ] org.scala-sbt#template-resolver;0.1!template-resolver.jar: The filename, directory name, or volume label syntax is incorrect (2316ms)
[FAILED ] org.scala-sbt#template-resolver;0.1!template-resolver.jar: (0ms)
==== local: tried
C:\Users\vinoli\.ivy2\local\org.scala-sbt\template-resolver\0.1\jars\template-resolver.jar
==== local-preloaded-ivy: tried
file:/C:/Users/vinoli/.sbt/preloaded/org.scala-sbt/template-resolver/0.1/jars/template-resolver.jar
==== local-preloaded: tried
file:/C:/Users/vinoli/.sbt/preloaded/org/scala-sbt/template-resolver/0.1/template-resolver-0.1.jar
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/template-resolver/0.1/template-resolver-0.1.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/template-resolver/0.1/jars/template-resolver.jar
==== sbt-ivy-snapshots: tried
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/template-resolver/0.1/jars/template-resolver.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: FAILED DOWNLOADS ::
:: ^ see resolution messages for details ^ ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#launcher-interface;1.0.1!launcher-interface.jar
:: org.scala-sbt#template-resolver;0.1!template-resolver.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
download failed: org.scala-sbt#launcher-interface;1.0.1!launcher-interface.jar
download failed: org.scala-sbt#template-resolver;0.1!template-resolver.jar
Error during sbt execution: Error retrieving required libraries
(see C:\Users\vinoli\.sbt\boot\update.log for complete log)
Error: Could not retrieve sbt 0.13.15
when i try to download java from http://java.com/getjava - its not even downloading .
can some one point out , what am i doing wrong here?
i use windows 10 -64 (fresh laptop)
installed jdk 1.8
The message you get is misleading. I also had the same issue, although sbt worked fine till yesterday, I encountered the same message today.
After some search I came up to the answer below which indicates that something is wrong with your PATH env. variable.
Running Jmeter gives 'findstr' is not recognized as an internal or external command
Right Click on My Computer, then click Properties, followed by Advanced System Settings > Environment Variables Look for the Path System Variable Add this path to the end, after a semicolon: C:\Windows\System32
Ok ... I found the issue...(my mistake actually)
I removed the sbt installed path (c:/programfiles/sbt/bin) which i added in the TMP environment variable. After removing (c:/programfiles/sbt/bin) from TMP, it worked.
thanks everyone for your suggestions :)

How can I provide SBT credentials to my private Artifactory server from a Windows workstation?

I'm using sbt 0.13.13 behind a corporate firewall on a Windows desktop.
We have an Artifactory which seems to be working very well for other build-tools, but I also want to get SBT working, however I'm not even able to make sbt 0.13.x boot!
When I try to boot SBT I get this error from the launcher:
C:\workspace\aggregator2>c:\apps\sbt-0.13.13\sbt-launcher-packaging-0.13.13\bin\sbt
Getting org.scala-sbt sbt 0.13.13 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;0.13.13
==== local: tried
C:\Users\USERNAME\.ivy2\local\org.scala-sbt\sbt\0.13.13\ivys\ivy.xml
-- artifact org.scala-sbt#sbt;0.13.13!sbt.jar:
C:\Users\USERNAME\.ivy2\local\org.scala-sbt\sbt\0.13.13\jars\sbt.jar
==== my-ivy-proxy-releases: tried
http://artifactory.bigcompany.com:8081/artifactory/virtual-sbt/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
==== my-maven-proxy-releases: tried
http://artifactory.bigcompany.com:8081/artifactory/virtual-sbt/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.pom
-- artifact org.scala-sbt#sbt;0.13.13!sbt.jar:
http://artifactory.bigcompany.com:8081/artifactory/virtual-sbt/org/scala-sbt/sbt/0.13.13/sbt-0.13.13.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.13: not found
::::::::::::::::::::::::::::::::::::::::::::::
Actually those URLs do exist - when I hit them with Chrome or Curl and provide credentials I am able to retrieve all the required resources.
When I look at the log I can see what's going on:
try to get credentials for: Artifactory Realm#artifactory.bigcompany.com
authentication: k='Artifactory Realm#artifactory.bigcompany.com' c='null'
HTTP response status: 401 url=http://artifactory.bigcompany.com:8081/artifactory/virtual-sbt/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
CLIENT ERROR: Unauthorized url=http://artifactory.bigcompany.com:8081/artifactory/virtual-sbt/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
my-ivy-proxy-releases: resource not reachable for org.scala-sbt#sbt;0.13.13: res=http://artifactory.bigcompany.com:8081/artifactory/virtual-sbt/org.scala-sbt/sbt/0.13.13/ivys/ivy.xml
my-ivy-proxy-releases: no ivy file found for org.scala-sbt#sbt;0.13.13
So it's clear that no credentials (or the wrong credentials are being sent). So I looked at how I've got it set up. I have a credentials file which looks something like this in %USERPROFILE%/.sbt/.credentials
realm=Artifactory Realm
host=artifactory.bigcompany.com
user=USERNAME
password=<my api key>
And I have a "plugin" file located at %USERPROFILE%.sbt\0.13\plugins\credentials.sbt which looks like this:
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
And I'm invoking sbt like this:
c:\apps\sbt-0.13.13\sbt-launcher-packaging-0.13.13\bin\sbt
Looking again at the logs - there's nothing at all which suggests that the credentials.sbt plugin has loaded, which in turn suggests that I've put the file in the wrong location or that there's something else about it that makes it unusable.
So can somebody help me - how do I need to tweak this setup so that it actually works? Is there some missing
I think I've encountered the same problem.
Since you've already created a proper credential file under %USERPROFILE%/.sbt/.credentials, you might need to set a system or user environment variable:
set SBT_CREDENTIALS=%USERPROFILE%/.sbt/.credentials

SBT can't resolve dependencies through proxy

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

How to use sbt behind authenticated proxy?

As given in other answers. I have properly set the value of http proxy host and port.
but it is giving the following error
Getting org.scala-sbt sbt 0.13.6 ...
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
:: problems summary ::
:::: WARNINGS
Host repo.typesafe.com not found. url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.6/ivys/ivy.xml
Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.pom
Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.jar
module not found: org.scala-sbt#sbt;0.13.6
==== local: tried
/home/vibhanshu/.ivy2/local/org.scala-sbt/sbt/0.13.6/ivys/ivy.xml
-- artifact org.scala-sbt#sbt;0.13.6!sbt.jar:
/home/vibhanshu/.ivy2/local/org.scala-sbt/sbt/0.13.6/jars/sbt.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.6/ivys/ivy.xml
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.pom
-- artifact org.scala-sbt#sbt;0.13.6!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.6: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.6: not found
Error during sbt execution: Error retrieving required libraries
(see /home/vibhanshu/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.6
I added the following line to .bashrc.
export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=proxy -Dhttp.proxyPort=port -Dhttps.proxyHost=proxy -Dhttps.proxyPort=port"
It works fine.
If you are in behind the proxy(corporate network)
For windows :
In sbt installation folder, go to conf/sbtconfig.txt file just add the following lines and save and try.
-Dhttp.proxyHost=proxy
-Dhttp.proxyPort=portno
-Dhttp.proxyUser=UserId
-Dhttp.proxyPassword=Password
-Dhttps.proxyHost=proxyhost
-Dhttps.proxyPort=portno
-Dhttps.proxyUser=UserId
-Dhttps.proxyPassword=Password
For Linux/Unix:
export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=proxyHost -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=UserId -Dhttp.proxyPassword=Password -Dhttps.proxyHost=proxyHost -Dhttps.proxyPort=proxyPortNumber -Dhttps.proxyUser=UserId -Dhttps.proxyPassword=Password"
It worked for me too.
I was facing the same issue (behind corporate firewall and getting this error message) and I tried all the options from various related threads but none of them resolved the problem. I was able to finally get IntelliJ to work by configuring HTTP Proxy in IntelliJ itself. Here's what my configurations look like (Note: provide your network username and password in related boxes):-

Grails. spring security core. Install problem

I try install Spring security core plugin in Grails.
I run this command:
grails install-plugin spring-security-core
and in result i see this error message:
:: problems summary ::
:::: WARNINGS
module not found: org.grails.plugins#spring-security-core;latest.integration
==== grailsPlugins: tried
-- artifact org.grails.plugins#spring-security-core;latest.integration!spring-security-core.zip:
C:\STS\LoginProject/lib/spring-security-core-[revision].zip
C:\Documents and Settings\fenuk\.grails\1.3.5\projects\LoginProject\plugins\hibernate-1.3.5/lib/spring-security-core-[revision].zip
C:\Documents and Settings\fenuk\.grails\1.3.5\projects\LoginProject\plugins\tomcat-1.3.5/lib/spring-security-core-[revision].zip
==== grailsHome: tried
C:\grails-1.3.5\lib/spring-security-core-[revision].xml
-- artifact org.grails.plugins#spring-security-core;latest.integration!spring-security-core.zip:
C:\grails-1.3.5\lib/spring-security-core-[revision].zip
==== grailsHome: tried
C:\grails-1.3.5\dist/spring-security-core-[revision].xml
-- artifact org.grails.plugins#spring-security-core;latest.integration!spring-security-core.zip:
C:\grails-1.3.5\dist/spring-security-core-[revision].zip
==== grailsHome: tried
-- artifact org.grails.plugins#spring-security-core;latest.integration!spring-security-core.zip:
C:\grails-1.3.5/plugins/grails-spring-security-core-[revision].zip
==== grailsCentral: tried
-- artifact org.grails.plugins#spring-security-core;latest.integration!spring-security-core.zip:
http://svn.codehaus.org/grails-plugins/grails-spring-security-core/tags/LATEST_RELEASE/grails-spring-security-core-[revision].zip
==== grailsCore: tried
-- artifact org.grails.plugins#spring-security-core;latest.integration!spring-security-core.zip:
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-spring-security-core/tags/LATEST_RELEASE/grails-spring-security-core-[revision].zip
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.grails.plugins#spring-security-core;latest.integration: not found
::::::::::::::::::::::::::::::::::::::::::::::
Error resolving plugin [name:spring-security-core, group:org.grails.plugins, version:latest.integration].
Plugin not found for name [spring-security-core] and version [not specified]
what this error mean? maybe, i do something wrong?
Make sure that you have at least the three core repositories in BuildConfig.groovy:
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
}
As a temporary workaround, you can install it directly by downloading the zip file. Go to http://grails.org/plugin/spring-security-core and click the big Download button, then install from the zip by running
grails install-plugin path/to/grails-spring-security-core-1.0.1.zip
You can also install it without downloading using
grails install-plugin http://plugins.grails.org/grails-spring-security-core/tags/RELEASE_1_0_1/grails-spring-security-core-1.0.1.zip
But I suspect you have a network issue, so the plugin install will fail since it uses Ivy to resolve the required Spring Security jars, and that download may also fail.