Install scala: no bin after decompression


#1

I download scala-sources-2.12.6.tar.gz “Sources”, my os is linux Redhat,
After decompression, here just shows these in scala-2.12.6:

CONTRIBUTING.md  LICENSE    admin      dbuild-meta.json  gitconfig.SAMPLE  scripts  src   tools
Gemfile          README.md  build.sbt  doc               project           spec     test  versions.properties

No “bin” here, so I wonder add which path to environmental variable to use it? like by:

export SCALA_HOME="/home/beeshma/scala-2.10.6"
export PATH="$PATH:$SCALA_HOME/bin"

"src" contains: (no executable file)

build     eclipse   interactive  library-aux  partest-extras     reflect  repl-jline  scalap
compiler  intellij  library      manual       partest-javaagent  repl     scaladoc

And I have installed sbt bin into my environmental variable, my java is 1.8.

Any suggestion will be grateful!


#2

Probably you meant to download a binary such as this binary file.

Some folks recommend just creating an sbt project and never installing scala as a command.


#3

Where did you download it from? Also if the file is called “sources” why do you expect it to containing anything else?


#4

Just for the record, “why do you expect it to containing anything else?” is not the same as explaining that there is a “source” distribution that is different from a “binary” distribution. Even though I “know better”, I think it is entirely reasonable to expect to “source an executable” from something that claims to be the “source” for that executable. In fact, world at large, it wouldn’t be terrible if I could obtain a “source” and then with one click perform whatever actions are required to enable it, including configure and make or what have you. Why is make more difficult than tar xfz? It’s just a command. Also sbt, if you could do that, one-click install from source, I would propose to you, if you are still single. Is sbt the single binary t-something?


#5

It wasn’t a rhetorical question.


#6

download place, at the bottom of this page.
expect it to containing “bin” so I can install like other sofewares…


#7

??? Hard to understand for me, are there some softwares work this way?


#8

binary file you mentioned is used for Mac OS X, Unix, Cygwin, but I’m linux Redhat, so it’s my choose


#9

If you’re on redhat you will probably want the rpm package. If you don’t want to install a package, those unix executables should also work. It’s just jar files and bash scripts.


#10

In my sbt folder, contains three folders, they are

bin conf lib
and in folder bin, there are one sbt executable file and others files
so I directly put
export PATH="/home/myname.../sbt/bin:$PATH"
in my .bashrc

I just hope scala install like this, now I don’t know what means “install” scala, but I guess not just download.


#11
  • Linux Redhat is a Unix, so you can still use the Unix package (https://downloads.lightbend.com/scala/2.12.6/scala-2.12.6.tgz) and “install” it like you did for SBT.
  • as others said, installing the RPM would also work.
  • nothing special about scala. For all software, if you download the sources, you cannot use it.* Download a binary package.

*or you can compile them and then use them, but that’s much more complicated and you do not need that.


#12

I see, very helpful, thanks!


#13

Can I say Debian is a Unix?


#14

Every Linux is a Unix. So yes, Debian as well. And Ubuntu, and ArchLinux, and Gentoo, and many many others.


#15

Thanks since I just wonder why they show like:
QQ%E5%9B%BE%E7%89%8720180906235321
so I think debian is special, not same with Unix and different with other linux os. May be at least for scala here, they are same thing, I guess.


#16

.deb is a Debian Package. The package manager that comes with Debian (and with several other popular Linux distributions, like Ubuntu) uses Debian Packages. While you can also use the general tarball and install manually, if you want to make use of the Debian Package Manager, you want to get the Debian package. It may be a good idea to change Debian to Debian Package.

Also, while I don’t want to have the discussion whether Linux distributions are technically Unixes, adding “Linux” to that list (and maybe even removing Unix) may be a good idea.


#17

That one is only for Debian. On Debian you can use that one, or the one that says Unix. The .tgz is more portable.


#18

I see, thank you giving me greater insight for this!


#19

If you are on RedHat, the easiest ad cleanest is to use the RPM file and install it using a standard package manager such as rpm or dnf. This makes it also easy to upgrade or remove.

Most Linux distributions fall into one of two categories: those that use the RedHat package management (using RPM files) and those that use the Debian package management (using DEB files). For example, Ubuntu has Debian package management and uses DEB files.


#20

Thanks!
I tried rpm,
rpm2cpio scala-2.12.6.rpm | cpio -div
but it shows me permission problem, copy part of them here:

cpio: ./usr/share/doc/scala/tools/scala.html: Cannot open: Permission denied                                                                        [85/1845]
./usr/share/doc/scala/tools/scala.html
cpio: ./usr/share/doc/scala/tools/scalac.html: Cannot open: Permission denied
./usr/share/doc/scala/tools/scalac.html
cpio: ./usr/share/doc/scala/tools/scaladoc.html: Cannot open: Permission denied
./usr/share/doc/scala/tools/scaladoc.html
cpio: ./usr/share/doc/scala/tools/scalap.html: Cannot open: Permission denied 

So I choose the first line’s scala-2.12.6.tgz, I also get my expected bin fold, this a solve way under my present situation.