How do I find what package provides `javac`?
I'd like to find what package is installed on Ubuntu 14.04 (server) that gives access to the javac
command. The RHEL line of distros has yum provides
for this, but there doesn't seem to be anything similar for the Debian family.
This AskUbuntu question suggests using dpkg -S
and apt-file
, but neither of these work:
$ sudo dpkg -S `which javac`
dpkg-query: no path found matching pattern /usr/bin/javac
apt-file search
appears to work at first:
$ apt-file search javac
javacc: /usr/bin/javacc
Except that apt-cache policy
shows that this package isn't even installed, so it's obviously not the package that provides javac
.
$ apt-cache policy javacc
javacc:
Installed: (none)
Candidate: 5.0-5
How can I find out what package provides the javac
command?
package-management java
add a comment |
I'd like to find what package is installed on Ubuntu 14.04 (server) that gives access to the javac
command. The RHEL line of distros has yum provides
for this, but there doesn't seem to be anything similar for the Debian family.
This AskUbuntu question suggests using dpkg -S
and apt-file
, but neither of these work:
$ sudo dpkg -S `which javac`
dpkg-query: no path found matching pattern /usr/bin/javac
apt-file search
appears to work at first:
$ apt-file search javac
javacc: /usr/bin/javacc
Except that apt-cache policy
shows that this package isn't even installed, so it's obviously not the package that provides javac
.
$ apt-cache policy javacc
javacc:
Installed: (none)
Candidate: 5.0-5
How can I find out what package provides the javac
command?
package-management java
Possible duplicate of How do I find the package that provides a file?
– Sergiy Kolodyazhnyy
Feb 7 at 19:31
add a comment |
I'd like to find what package is installed on Ubuntu 14.04 (server) that gives access to the javac
command. The RHEL line of distros has yum provides
for this, but there doesn't seem to be anything similar for the Debian family.
This AskUbuntu question suggests using dpkg -S
and apt-file
, but neither of these work:
$ sudo dpkg -S `which javac`
dpkg-query: no path found matching pattern /usr/bin/javac
apt-file search
appears to work at first:
$ apt-file search javac
javacc: /usr/bin/javacc
Except that apt-cache policy
shows that this package isn't even installed, so it's obviously not the package that provides javac
.
$ apt-cache policy javacc
javacc:
Installed: (none)
Candidate: 5.0-5
How can I find out what package provides the javac
command?
package-management java
I'd like to find what package is installed on Ubuntu 14.04 (server) that gives access to the javac
command. The RHEL line of distros has yum provides
for this, but there doesn't seem to be anything similar for the Debian family.
This AskUbuntu question suggests using dpkg -S
and apt-file
, but neither of these work:
$ sudo dpkg -S `which javac`
dpkg-query: no path found matching pattern /usr/bin/javac
apt-file search
appears to work at first:
$ apt-file search javac
javacc: /usr/bin/javacc
Except that apt-cache policy
shows that this package isn't even installed, so it's obviously not the package that provides javac
.
$ apt-cache policy javacc
javacc:
Installed: (none)
Candidate: 5.0-5
How can I find out what package provides the javac
command?
package-management java
package-management java
asked Feb 7 at 19:27
Borea DeitzBorea Deitz
83
83
Possible duplicate of How do I find the package that provides a file?
– Sergiy Kolodyazhnyy
Feb 7 at 19:31
add a comment |
Possible duplicate of How do I find the package that provides a file?
– Sergiy Kolodyazhnyy
Feb 7 at 19:31
Possible duplicate of How do I find the package that provides a file?
– Sergiy Kolodyazhnyy
Feb 7 at 19:31
Possible duplicate of How do I find the package that provides a file?
– Sergiy Kolodyazhnyy
Feb 7 at 19:31
add a comment |
2 Answers
2
active
oldest
votes
In some cases, additional sleuthing is required. In particular,
$ ls -l $(which javac)
lrwxrwxrwx 1 root root 23 May 24 2017 /usr/bin/javac -> /etc/alternatives/javac
shows that /usr/bin/javac
is a symbolic link - so we can either use readlink
to drill down:
$ dpkg -S "$(readlink -f $(which javac))"
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
or (seeing as it's an update-alternatives
link)
$ update-alternatives --query javac
Name: javac
Link: /usr/bin/javac
Slaves:
javac.1.gz /usr/share/man/man1/javac.1.gz
Status: auto
Best: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Value: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Alternative: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Priority: 1081
Slaves:
javac.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz
from which we can pick out the current value:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Very nice. This was the issue.dpkg -S "$(readlink -f $(which javac))"
worked, and the package isopenjdk-7-jdk
(confirmed byapt-cache policy
). Thanks!
– Borea Deitz
Feb 7 at 19:48
You should userealpath
to simplify your process:dpkg -S "$(realpath $(which javac))"
.
– Fólkvangr
Feb 8 at 9:39
add a comment |
Looks like /usr/bin/javac
is a symlink managed by update-alternatives
. What do you see if you readlink -f /usr/bin/javac
? If it's pointing somewhere else, perhaps check that location with dpkg -S
? Or update-alternatives
itself can tell you which options you have for a particular link, eg:
$ update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Nothing to configure.
So then:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
All files in that package: https://packages.ubuntu.com/xenial/openjdk-8-jdk-headless/filelist
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1116486%2fhow-do-i-find-what-package-provides-javac%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In some cases, additional sleuthing is required. In particular,
$ ls -l $(which javac)
lrwxrwxrwx 1 root root 23 May 24 2017 /usr/bin/javac -> /etc/alternatives/javac
shows that /usr/bin/javac
is a symbolic link - so we can either use readlink
to drill down:
$ dpkg -S "$(readlink -f $(which javac))"
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
or (seeing as it's an update-alternatives
link)
$ update-alternatives --query javac
Name: javac
Link: /usr/bin/javac
Slaves:
javac.1.gz /usr/share/man/man1/javac.1.gz
Status: auto
Best: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Value: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Alternative: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Priority: 1081
Slaves:
javac.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz
from which we can pick out the current value:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Very nice. This was the issue.dpkg -S "$(readlink -f $(which javac))"
worked, and the package isopenjdk-7-jdk
(confirmed byapt-cache policy
). Thanks!
– Borea Deitz
Feb 7 at 19:48
You should userealpath
to simplify your process:dpkg -S "$(realpath $(which javac))"
.
– Fólkvangr
Feb 8 at 9:39
add a comment |
In some cases, additional sleuthing is required. In particular,
$ ls -l $(which javac)
lrwxrwxrwx 1 root root 23 May 24 2017 /usr/bin/javac -> /etc/alternatives/javac
shows that /usr/bin/javac
is a symbolic link - so we can either use readlink
to drill down:
$ dpkg -S "$(readlink -f $(which javac))"
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
or (seeing as it's an update-alternatives
link)
$ update-alternatives --query javac
Name: javac
Link: /usr/bin/javac
Slaves:
javac.1.gz /usr/share/man/man1/javac.1.gz
Status: auto
Best: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Value: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Alternative: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Priority: 1081
Slaves:
javac.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz
from which we can pick out the current value:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Very nice. This was the issue.dpkg -S "$(readlink -f $(which javac))"
worked, and the package isopenjdk-7-jdk
(confirmed byapt-cache policy
). Thanks!
– Borea Deitz
Feb 7 at 19:48
You should userealpath
to simplify your process:dpkg -S "$(realpath $(which javac))"
.
– Fólkvangr
Feb 8 at 9:39
add a comment |
In some cases, additional sleuthing is required. In particular,
$ ls -l $(which javac)
lrwxrwxrwx 1 root root 23 May 24 2017 /usr/bin/javac -> /etc/alternatives/javac
shows that /usr/bin/javac
is a symbolic link - so we can either use readlink
to drill down:
$ dpkg -S "$(readlink -f $(which javac))"
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
or (seeing as it's an update-alternatives
link)
$ update-alternatives --query javac
Name: javac
Link: /usr/bin/javac
Slaves:
javac.1.gz /usr/share/man/man1/javac.1.gz
Status: auto
Best: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Value: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Alternative: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Priority: 1081
Slaves:
javac.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz
from which we can pick out the current value:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
In some cases, additional sleuthing is required. In particular,
$ ls -l $(which javac)
lrwxrwxrwx 1 root root 23 May 24 2017 /usr/bin/javac -> /etc/alternatives/javac
shows that /usr/bin/javac
is a symbolic link - so we can either use readlink
to drill down:
$ dpkg -S "$(readlink -f $(which javac))"
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
or (seeing as it's an update-alternatives
link)
$ update-alternatives --query javac
Name: javac
Link: /usr/bin/javac
Slaves:
javac.1.gz /usr/share/man/man1/javac.1.gz
Status: auto
Best: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Value: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Alternative: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Priority: 1081
Slaves:
javac.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz
from which we can pick out the current value:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
answered Feb 7 at 19:39
steeldriversteeldriver
68.7k11113184
68.7k11113184
Very nice. This was the issue.dpkg -S "$(readlink -f $(which javac))"
worked, and the package isopenjdk-7-jdk
(confirmed byapt-cache policy
). Thanks!
– Borea Deitz
Feb 7 at 19:48
You should userealpath
to simplify your process:dpkg -S "$(realpath $(which javac))"
.
– Fólkvangr
Feb 8 at 9:39
add a comment |
Very nice. This was the issue.dpkg -S "$(readlink -f $(which javac))"
worked, and the package isopenjdk-7-jdk
(confirmed byapt-cache policy
). Thanks!
– Borea Deitz
Feb 7 at 19:48
You should userealpath
to simplify your process:dpkg -S "$(realpath $(which javac))"
.
– Fólkvangr
Feb 8 at 9:39
Very nice. This was the issue.
dpkg -S "$(readlink -f $(which javac))"
worked, and the package is openjdk-7-jdk
(confirmed by apt-cache policy
). Thanks!– Borea Deitz
Feb 7 at 19:48
Very nice. This was the issue.
dpkg -S "$(readlink -f $(which javac))"
worked, and the package is openjdk-7-jdk
(confirmed by apt-cache policy
). Thanks!– Borea Deitz
Feb 7 at 19:48
You should use
realpath
to simplify your process: dpkg -S "$(realpath $(which javac))"
.– Fólkvangr
Feb 8 at 9:39
You should use
realpath
to simplify your process: dpkg -S "$(realpath $(which javac))"
.– Fólkvangr
Feb 8 at 9:39
add a comment |
Looks like /usr/bin/javac
is a symlink managed by update-alternatives
. What do you see if you readlink -f /usr/bin/javac
? If it's pointing somewhere else, perhaps check that location with dpkg -S
? Or update-alternatives
itself can tell you which options you have for a particular link, eg:
$ update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Nothing to configure.
So then:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
All files in that package: https://packages.ubuntu.com/xenial/openjdk-8-jdk-headless/filelist
add a comment |
Looks like /usr/bin/javac
is a symlink managed by update-alternatives
. What do you see if you readlink -f /usr/bin/javac
? If it's pointing somewhere else, perhaps check that location with dpkg -S
? Or update-alternatives
itself can tell you which options you have for a particular link, eg:
$ update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Nothing to configure.
So then:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
All files in that package: https://packages.ubuntu.com/xenial/openjdk-8-jdk-headless/filelist
add a comment |
Looks like /usr/bin/javac
is a symlink managed by update-alternatives
. What do you see if you readlink -f /usr/bin/javac
? If it's pointing somewhere else, perhaps check that location with dpkg -S
? Or update-alternatives
itself can tell you which options you have for a particular link, eg:
$ update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Nothing to configure.
So then:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
All files in that package: https://packages.ubuntu.com/xenial/openjdk-8-jdk-headless/filelist
Looks like /usr/bin/javac
is a symlink managed by update-alternatives
. What do you see if you readlink -f /usr/bin/javac
? If it's pointing somewhere else, perhaps check that location with dpkg -S
? Or update-alternatives
itself can tell you which options you have for a particular link, eg:
$ update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Nothing to configure.
So then:
$ dpkg -S /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
openjdk-8-jdk-headless:amd64: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
All files in that package: https://packages.ubuntu.com/xenial/openjdk-8-jdk-headless/filelist
answered Feb 7 at 19:36
mikepurvismikepurvis
221212
221212
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1116486%2fhow-do-i-find-what-package-provides-javac%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of How do I find the package that provides a file?
– Sergiy Kolodyazhnyy
Feb 7 at 19:31