SDK Manager

1. Installation:

Installing SDKMAN! on UNIX-like platforms is as easy as ever. SDKMAN! installs smoothly on Mac OSX, Linux, Cygwin, Solaris and FreeBSD. We also support Bash and ZSH shells. Simply open a new terminal and enter:

$ curl -s "https://get.sdkman.io" | bash

Follow the instructions on-screen to complete installation. Next, open a new terminal or enter:

$ source "$HOME/.sdkman/bin/sdkman-init.sh"

Lastly, run the following code snippet to ensure that installation succeeded:

==== BROADCAST =================================================================
* 06/12/16: Scala 2.12.1 released on SDKMAN! #scala
* 23/11/16: Gradle 3.2.1 released on SDKMAN! #gradle
* 22/11/16: Ceylon 1.3.1 released on SDKMAN! #ceylonlang
================================================================================
SDKMAN 5.2.1+136

2. Usage:

2.1 Installing an SDK:

2.1.1 Latest Stable:

Install the latest stable version of your SDK of choice (say, Java JDK) by running the following command:

$ sdk install java

You will see something like the following output:

Downloading: java 8u111

In progress...

######################################################################## 100.0%

Installing: java 8u111
Done installing!

Now you will be prompted if you want this version to be set as default. Do you want java 8u111 to be set as default? (Y/n): Answering yes (or hitting enter) will ensure that all subsequent shells opened will have this version of the SDK in use by default. Setting java 8u111 as default.

2.1.2 Specific Version:

Need a specific version of an SDK? Simply qualify the version you require:

$ sdk install scala 2.12.1

All subsequent steps same as above.

2.1.3 Install Local Version(s):

Need a snapshot? Already have a local installation? Setup a local version:

$ sdk install groovy 3.0.0-SNAPSHOT /path/to/groovy-3.0.0-SNAPSHOT

2.2 Remove Version:

Remove an installed version.

$ sdk remove scala 2.11.6

2.3 List Candidates:

To get a listing of available Candidates:

$ sdk list

This will render a searchable alphabetic list with name, current stable default version, website URL, description and easy install command for each Candidate. The output is piped to less so standard keyboard shortcuts may be used with q to exit.

2.4 List Versions:

To get a listing of Candidate Versions:

$ sdk list groovy This will result in a list view showing the available, local, installed and current versions of the SDK.

================================================================================
Available Groovy Versions
================================================================================
 > * 2.4.4                2.3.1                2.0.8                1.8.3
     2.4.3                2.3.0                2.0.7                1.8.2
     2.4.2                2.2.2                2.0.6                1.8.1
     2.4.1                2.2.1                2.0.5                1.8.0
     2.4.0                2.2.0                2.0.4                1.7.9
     2.3.9                2.1.9                2.0.3                1.7.8
     2.3.8                2.1.8                2.0.2                1.7.7
     2.3.7                2.1.7                2.0.1                1.7.6
     2.3.6                2.1.6                2.0.0                1.7.5
     2.3.5                2.1.5                1.8.9                1.7.4
     2.3.4                2.1.4                1.8.8                1.7.3
     2.3.3                2.1.3                1.8.7                1.7.2
     2.3.2                2.1.2                1.8.6                1.7.11
     2.3.11               2.1.1                1.8.5                1.7.10
     2.3.10               2.1.0                1.8.4                1.7.1

================================================================================
+ - local version
* - installed
> - currently in use
================================================================================

2.5 Use Version:

Choose to use a given version in the current terminal:

$ sdk use scala 2.12.1

It is important to realise that this will switch the candidate version for the current shell only. To make this change permanent, use the default command instead.

2.6 Default Version:

Chose to make a given version the default:

$ sdk default scala 2.11.6
This will ensure that all subsequent shells will start with version 2.11.6 in use.

2.7 Current Version(s):

To see what is currently in use for a Candidate:

$ sdk current java
Using java version 8u111

To see what is currently in use for all Candidates:

$ sdk current
Using:
groovy: 2.4.7
java: 8u111
scala: 2.12.1

3. Uninstallation:

In the unlikely event that you would like to uninstall SDKMAN!, we don't have an automated way of doing this yet. If you really do want to remove it from your system, it is very easy to do so.The following will guide you through backing up, then removing the entire installation from your system.

tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman
$ rm -rf ~/.sdkman

The last step involves editing and removing the initialisation snippet from your .bashrc, .bash_profile and/or .profile files. If you use ZSH, remove it from the .zshrc file. The snippet of code to be removed looks something like this:

#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
 -s "/home/dudette/.sdkman/bin/sdkman-init.sh"  && source "/home/dudette/.sdkman/bin/sdkman-init.sh"

Once removed, you have successfully uninstalled SDKMAN! from your machine.

Technology & Innovation

0 Comments

Leave a Reaply

recent posts

tags

Subscribe to Newsletter