classpath

Is there any way to change a properties file that is in my classpath?

家住魔仙堡 提交于 2020-01-07 02:18:13
问题 I have a properties file that is in my classpath. My requirement is to change some properties in this file based on some inputs I get from arguments. The nature of arguments decide whether I need to change the properties and if yes which properties to change. The problem is that all classpath entries are loaded at the application startup time, so changing from within my application would not have any effect. How do I overcome this problem? One possible solution I can think of is to not add

How do i diagnose and fix classpath problems?

不想你离开。 提交于 2020-01-06 15:17:34
问题 I have a tycho project that includes xtend sources. One of my dependencies comes with an older version of JUnit that does not include all features that i need. I also have a dependency on JUnit 4.11. Tycho build is fine, but the xtend compiler (xtend-maven-plugin) seems to see the old JUnit version instead of the new one. How can i fix this? [EDIT] To clarify, this is how my dependencies look like: Project A |--Project B | |-- JUnit 4.8.2 |--JUnit 4.11 In the OSGi world of tycho, this is no

MySql Database Connection Issues - ClassNotFoundException

戏子无情 提交于 2020-01-06 12:36:25
问题 I am attempting to fetch User Information, and then display it onto a Table in Swing. Currently I am getting an error as follows each time I execute the piece of code below. Error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown

Classpath problems with Jini ClassDep, Java's dependency finder

允我心安 提交于 2020-01-06 08:19:08
问题 I started to use Sun's ClassDep as a solution to fight the inclusion of unnecessary JARs in my resulting WAR application. It seems to rock. However, this beast is hard to tame! I'm getting several errors of classes not found even if they are explicitly included in the classpath I pass to it. Example: couldn't find: org.apache.log4j.Logger: No file for: Logger couldn't find: org.hibernate.Session: No file for: Session couldn't find: org.joda.time.LocalDate: No file for: LocalDate HOWEVER...

Adding com.sun.tools.jar in classpath of jar

混江龙づ霸主 提交于 2020-01-06 05:25:14
问题 I'm having trouble using tools.jar present in jdk1.8.0_121/lib/tools.jar . My $JAVA_HOME is set to: # echo $JAVA_HOME /usr/local/java/jdk1.8.0_121 The path to tools.jar is : # ls /usr/local/java/jdk1.8.0_121/lib/tools.jar /usr/local/java/jdk1.8.0_121/lib/tools.jar And I use the following java executable to run the code: /usr/local/java/jdk1.8.0_161/bin/java But, when I access the VirtualMachine class, it throws Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine

After importing a Maven project into IntelliJ 2019.3, the bundled classes are not on class path

自作多情 提交于 2020-01-05 08:29:08
问题 After importing a newly created Vaadin 14.0.x project, and using the Import Project feature to create a Maven-driven project in IntelliJ 2019.3 EAP, I get a message saying "Cannot resolving symbol". The error message offers me a button to "Add library … to classpath". But the necessary libraries are already loaded by Maven as dependencies. So this makes no sense. I retried the import 3 times. On each effort I opened another project to run the File > Invalidate Caches / Restart menu item. This

Controlling the order of how JARs are loaded in the classpath

ぃ、小莉子 提交于 2020-01-05 07:57:25
问题 I'm using GWT 2.4 with gquery-dnd-bundle 1.0.4 so that I can construct trees with drag-and-drop nodes. I've bumped into an annoying bug (http://code.google.com/p/gwtquery-plugins/issues/detail?id=6). The gist of it is I need to guarantee that the file "gquery-dnd-bundle-1.0.4.jar" gets loaded by the classloader at runtime before the gwt-servlet.jar file in my WEB-INF/lib directory. How can I guarantee this? I'm using Eclipse Indigo with a GWT Web Application project if that is useful. Here's

Classpath is set, but still getting NoClassDefFoundError

三世轮回 提交于 2020-01-05 07:46:12
问题 I'm trying to package a very simple app into a jar to distribute to a user. I'm using Eclipse Indigo with the m2e plugin on Mac OS X 10.6.8. I used the Maven build: package goal to package it as a jar. If I double click on the jar to open it, the GUI opens and appears to be working, but when I click the execute button, nothing happens. (The program works fine if I do Run As... within Eclipse). If I try to run the jar from the command line, it won't even open the GUI, I get this error:

Compiling and running Java app

倖福魔咒の 提交于 2020-01-05 07:27:16
问题 The problem: I can't get my java app to run after compiling. My guess is there's something wrong my classpaths. Just to clear things up I have used an IDE, Eclipse, and I originally used that to compile and run my application. It ran perfectly, but now I need to run it strictly through the terminal/command line. The reason is that I follow a guideline that if it cant be run on the command line then it doesn't exist. (Helps me really get to know my applications) Anyway here's the environment

Compiling and running Java app

女生的网名这么多〃 提交于 2020-01-05 07:27:09
问题 The problem: I can't get my java app to run after compiling. My guess is there's something wrong my classpaths. Just to clear things up I have used an IDE, Eclipse, and I originally used that to compile and run my application. It ran perfectly, but now I need to run it strictly through the terminal/command line. The reason is that I follow a guideline that if it cant be run on the command line then it doesn't exist. (Helps me really get to know my applications) Anyway here's the environment