I don't use openjdk environment, and I've got oracle java installed, then linked the java / javac binaries to /usr/bin.

Now when I build packages that requires java-runtime package, I had to edit the PKGBUILD everytime to strip off the dependency of that package.

So, can I insert a record somewhere, so that make pacman believe java-runtime is installed already?


I didn't use any package to install oracle java, I just extracted it some where then linked the binaries to $PATH

  • Doas archlinux support a kind of virtual packages like others distros do? That could be a solution. For example, in my gentoo, there is a package called virtual/jre I can install so that my system know I do have a jre installed whichever implementation I choose.
    – lgeorget
    Apr 25, 2013 at 2:44
  • 2
    lgeorget - Yes, by using the provides PKGBUILD directive.
    – Chris Down
    Apr 25, 2013 at 6:14
  • 1
    If you mean the jre package by oracle java then please provide more information because it does provide java-runtime. It also provides scripts for /etc/profile.d that automatically add the java folder to your $PATH, set $JAVA_HOME and whatnot making the manual linking to /usr/bin unnecessary.
    – Wieland
    Apr 25, 2013 at 8:29
  • @Wieland java is working fine; and see my update
    – daisy
    Apr 25, 2013 at 9:32
  • It's possible to create PKGBUILDs that produce empty packages (simply change the package function to just /bin/true) but it is not a good idea. Unless you have a very good reason not to, you should really install a package for the JRE and be done with it.
    – Wieland
    Apr 25, 2013 at 12:58

2 Answers 2


In a similar situation on Ubuntu, I just installed the (repeatedly) required package and removed the individual files afterwards, based on list of installed file the package manager told me about. Just make sure nothing of your own installation gets overwritten.

The one thing I found over time is that some package use their installation scripts to generate additional data those are of course not in the package's file list.

  • 1
    Installing a package and manually removing its files is really not a solution to anything because you're basically doing things behind your package managers back that shouldn't be done.
    – Wieland
    Apr 25, 2013 at 8:31
  • 2
    The OP probably already went behind the package managers back by installing a Java without that install telling the package managers that it fulfilled the java-runtime prerequisite. (Could of course be that that package was wrong but I assume that he installed from source).
    – Anthon
    Apr 25, 2013 at 8:54

I am using Arch linux: I generated (then deleted) a PKGBUILD file describing a package named "fake-java" with no files which provides "java-environment=7". I ran updpkgsums, makepkg, then on the newly-generated tar.xz file, pacman -U.

So far it has worked.

  • I'd like to comment that now I use the "jdk" package from the AUR. My solution above is appropriate if you don't want to install Java, but if you do have some java installation you should put it into the package. Jul 1, 2015 at 21:12

You must log in to answer this question.

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