Jar hell: how to use a classloader to replace one jar library version with another at runtime

I can’t believe that for more than 4 years no one has answered this question correctly. https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html The ClassLoader class uses a delegation model to search for classes and resources. Each instance of ClassLoader has an associated parent class loader. When requested to find a class or resource, a ClassLoader instance will delegate the search … Read more

“Could not find the main class” error when running jar exported by Eclipse

Verify that you can start your application like that: java -cp myjarfile.jar snake.Controller I just read when I double click on it – this sounds like a configuration issue with your operating system. You’re double-clicking the file on a windows explorer window? Try to run it from a console/terminal with the command java -jar myjarfile.jar … Read more

java.net maven repo – JMS artifact missing

Realizing that the Sun’s JARs are not on Maven central due to licensing issues, I added the following Maven repo to my POM Yeah, but http://download.java.net/maven/2/javax/ doesn’t have the jms artifact… The good news is that the JBoss Nexus repository does have it: <repository> <id>repository.jboss.org-public</id> <name>JBoss repository</name> <url>https://repository.jboss.org/nexus/content/groups/public</url> </repository>

Unable to create SAAJ meta-factory after packaging as JAR

I just added the following dependency to my project: <dependency> <groupId>com.sun.xml.messaging.saaj</groupId> <artifactId>saaj-impl</artifactId> <version>1.5.1</version> </dependency> If you are using a version older than 1.5.1, you need to create the file META-INF/services/javax.xml.soap.SAAJMetaFactory with the following line to provide the fully-qualified name of the SAAJ factory class and it worked: com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl The javax.xml.soap.saaj-api seems to be abandoned. And … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)