0

I need to upgrade Gradle in my Linux Mint box. After installing the latest version, I changed the symbolic link with a command something like

ln -s /usr/bin/gradle /alternatives/bin/gradle
ln -s /alternatives/bin/gradle /usr/lib/gradle/6.1/bin

That change didn't alter the link at all. Then, I remember that I need to use

update-alternatives --config 

to modify the link. After the change, I can't see the gradle path with

which gradle

What I shall do to resolve the problem with the following information?

abc@linux-mint ~ $ find -L /usr/bin -mindepth 15
find: ‘/usr/bin/gradle’: Too many levels of symbolic links
find: File system loop detected; ‘/usr/bin/X11’ is part of the same file system loop as ‘/usr/bin’.

And

oem@oem-270s ~ $ ls -l /usr/lib/gradle/6.1/bin
total 4
lrwxrwxrwx 1 root root   24 Jan 30 15:05 gradle -> /etc/alternatives/gradle
-rwxr-xr-x 1 root root 2932 Jan 31  1980 gradle.bat
5
  • 1
    What is the output of ls -l /usr/lib/gradle/6.1/bin? It is likely that you have created a loop.
    – icarus
    Feb 3, 2020 at 20:06
  • @icarus You likely is correct. I might mistype a command to get a cycle link. I add the output to my post.
    – vic
    Feb 3, 2020 at 22:21
  • 2
    xkcd.com/981 Feb 3, 2020 at 22:33
  • 1
    So you have /usr/lib/gradle/6.1/bin/gradle which is a link to /etc/alternatives/gradle which is a link to /usr/bin/gradle which is probably a link to /etc/alternatives/gradle which is a link to /usr/bin/gradle which is probably a link to ... I think you got the two filenames to the ln command the wrong way around. I suggest reinstalling the latest gradle and then ln -s /usr/lib/gradle/6.1/bin/gradle /etc/alternatives/gradle
    – icarus
    Feb 4, 2020 at 0:04
  • I have reinstalled the latest version of Gradle and the situation hasn't changed. I believe that I shouldn't use ln, which is the cause in the first place, but update-alternatives. I, however, don't know how to reconstruct the links.
    – vic
    Feb 4, 2020 at 18:18

1 Answer 1

0

I solved this problem by removing all versions of Gradle installments and reinstalled the 6.1 version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .