0

The problem is I have javax.activation library in Java8JDK/Library and an updated javax.activation library added using maven dependency. While executing it uses library from Java8JDK/Library. How do I enforce it to use it from the library added using maven dependency. As we can see in the image it used library from jdk as default

  • Do you really mean that your library has a class with the same qualified name as a class in the JDK? – J Fabian Meier Aug 20 '20 at 14:47
  • Do you plan on packaging your application as a jar or fat-jar ? This could be solved using maven shade plugin. I have this exact same example working with `javax.activation`and jdk 8 in my current project without any issue. I can post my example as an answer any time. – gdaly Aug 20 '20 at 15:06
  • Basically I want it to look into libraries added in maven dependency and then look into java libraries if not fount. Not the other way – Sanjay Shetty Aug 20 '20 at 15:22
  • My problem is I want to use javax.activation library added using dependecies section in pom.xml. But when I run my application It uses javax.activation from jdk8(outdated code). So please sujjest a solution. My project is packaged as war. @gdaly @J Fabian Meier – Sanjay Shetty Aug 20 '20 at 15:33
  • @SanjayShetty: Please have a look at this thread https://stackoverflow.com/a/55477709/10105840 as it seems to fit your needs from what you describes. If it is, just answer to your own question with your solution ! The solution I suggested earlier does not work as is as you cannot package shaded .war with maven shade plugin – gdaly Aug 20 '20 at 16:07
  • That didnt help. @gdaly. It still uses the default(JDK8) activation library. – Sanjay Shetty Aug 20 '20 at 18:09

0 Answers0