0

I have multiple JDKs configured in my system i.e. JDK 8, 9 & 10 (early access). I need to execute the Jdeps tool available in JDK 9, however on issuing the jdeps -version command the one available in JDK 8 is getting executed.

I have the PATH and JAVA_HOME environment variables set properly to JDK 9 path. When I issue java -version command it shows me the JDK 9 version, but surprisingly jdeps isn't behaving in that manner.

Can someone pls tell me how do I execute jdeps available in JDK 9?

Failed attempts so far:

  1. PATH & JAVA_HOME set to JDK 9
  2. Executed the command from < JDK9 >/bin directory

Completely removing JDK 8 for now, is not an option for me right now

Screenshots FYR

  1. pwd: I'm currently in JDK 9's bin directory
  2. JAVA_HOME: Points to JDK 9
  3. PATH: I've intentionally skipped the JDK/bin directory here to prove the point that path doesn't point to any other JDK version
  4. java -version: Hence proved that there's other java version being referred by PATH
  5. Added jdk(9)/bin to PATH
  6. java -version: We can see that JDK 9 is being used. Also the latest value added to PATH is fine
  7. jdeps -version: Here comes the trouble! It's JDK 8 used by jdeps
Curious Coder
  • 646
  • 8
  • 18
  • Is this macOS? Are you relying on the sym links in /usr/bin? Are you 200% sure that your PATH includes the JDK 9 bin directory before the JDK 8 bin directory? – Alan Bateman Feb 25 '18 at 16:43
  • If the (2) stated by you doesn't work, I wonder what else could one rely upon. OR (thinking more about what you might be doint wrong) you are not trying it this way `/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/jdeps -version`. Hope you're getting, that the reference could be incorrect there inspite of you being at any directory. Just be sure about it I would insist. To add to the question could you share sample screens of above as well? – Naman Feb 25 '18 at 18:04
  • 1
    @AlanBateman: No, this isn't on Mac OS. I'm trying this out on my CentOS VM – Curious Coder Feb 26 '18 at 00:49
  • @nullpointer: Yes I've tried it the way you've mentioned. Adding screenshots on your request – Curious Coder Feb 26 '18 at 00:58
  • 1
    What does `which jdeps` print? What does `alias jdeps` print? – Alan Bateman Feb 26 '18 at 08:14
  • @AlanBateman: I tried `which jdeps` and it gave me a weird location somewhere in `/usr/bin`, where jdeps was a symbolic link pointing somewhere else. This might be a part of my VM setup, I'm not sure. Anyways, thank you very much for the useful pointer! – Curious Coder Feb 26 '18 at 13:13
  • I'm digging this further to understand if this is indeed an issue with my VM setup. If I get sufficient evidence to prove this, I shall discard this post – Curious Coder Feb 26 '18 at 13:18

0 Answers0