Installing Artifactory on Ubuntu
Join the DZone community and get the full member experience.Join For Free
i was messing around with some permissions settings on our “live” verison of artifactory, as you do, and then suddenly i thought “no! this feels wrong… i’m sure there’s someone who would be having a fit right now if he knew i was guffing around with the permissions on the live version of artifactory…”. that someone is of course me. so i duly pressed cancel, and decided to do things “properly”, i.e. install a local version of artifactory and mess around with that one instead.
easier said than done.
how not to install artifactory on ubuntu
if you want to know how to install artifactory on ubuntu, i’d suggest skipping to the “how to install artifactory on ubuntu” section, below. however, if you’d love to know exactly how to not install artifactory on ubuntu while following the artifactory installation instructions and getting really annoyed, then read on!
i decided to install it on my ubuntu virtualbox vm, because surely that would be easier than installing it on my windows box, right? my ubuntu vm is running java 1.7. so i downloaded the artifactory zip and extracted it. dead easy! then i followed this particular instruction on the artifactory installation webpage:
before you install is recommended you first verify your current environment by running artifactoryctl check under the $artifactory_home/bin folder
but by default it wasn’t executable, so i had to chmod it, duuuuh! so i did that, ran it, and i got the following error:
artifactory_home not set
er, well, no, i haven’t set artifactory_home, that’s true. i had no idea i had to set it anywhere. so i set it in my profile, sourced it, and all that stuff.
i ran the artifactoryctl check command again and got another message saying:
cannot find a jre or jdk. please set java_home to a >=1.5
but that’s rubbish! i totally have 1.7 installed!! i checked my paths and all the rest. all looked fine to me. after a little while i got bored of seeing that exact same message, so i decided to just stop bothering with this stupid “artifactoryctl check” thing, and just moved on with the installation by running the $artifactory_home/bin/install.sh script
gah! not logged in as root. sudo sudo sudo.
that’s better. i got a little message saying “success” which was nice, followed by:
installation of artifactory completed. you can now check installation by running:
> service artifactory check
okey dokey then, i’ll go do that!
gahh!!! sudo make me a sandwich!!!
sudo !! is probably my most frequently typed command, along with “ll” (swiftly followed by “ls -a” when i realsie the ll alias hasn’t been setup. i’m an idiot, ya’see).
anyway, following a swift sudo !! i got the following message:
found java= in java_home=
cannot find a jre or jdk. please set java_home to a >=1.5 jre
erm, i’m pretty sure that’s not right. i definitely remember installing java 1.7 and setting java_home. so i echoed java_home. sure enough, it’s pointing to my 1.7 installation path.
turns out that setting it my bash profile wasn’t good enough, and i hat to also put it in the following file:
oh, and don’t put the symlink path in for java_home, that didn’t
work. i had to put the full path in (/usr/bin/java got me nowhere). i
literally had to put the full location in (mine was
/usr/lib/jvm/java-7-openjdk-amd64/jre/). anyway, that just about did it.
how to install artifactory on ubuntu
- make sure you’ve got java 1.5 or above installed, and make a note of the full path, as you’re going to need this later (mine was /usr/lib/jvm/java-7-openjdk-amd64/jre/).
- download the artifactory zip and extract it somewhere.
- go to your artifactory bin dir and make the install.sh file executable
- now run sudo ./install.sh – this will copy some files around the place and setup some paths.
- edit the file /etc/artifactory/default and put the full java path in there as java_home
- make sure java_home is also set in /etc/environment
- run “sudo service artifactory check”
- if it all looks good run “sudo service artifactory start”
- go to http://localhost:8081/artifactory/
- you’re done!
Published at DZone with permission of James Betteley, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.