classpath

Unable to find a javac compiler com.sun.tools.javac.Main is not on the classpath error

烂漫一生 提交于 2020-01-10 18:56:07
问题 I am trying to run java application and I am getting following error, Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK I have gone through many SO questions and found solution is JAVA_HOME should be point to JDK, not JRE . Then I have tried to print JAVA_HOME in command prompt, I had set this JAVA_HOME from my computer->properties->env variables -> system vars as below, I had also added new variable in eclipse using

How to put classes for javaagent in the classpath

喜夏-厌秋 提交于 2020-01-10 18:23:36
问题 I am trying to develop a javaagent that would instrument code with help of asm-4. For now I'm stucked with a pretty basic problem, the classloader for the javaagent doesn't see asm dependencies and therefor fails. Do I have to provide a jar-with-dependencies (aka maven build plugin) which contains all the needed classes by the agent, or is there another way to add classes to the java agent? Referencing the jar asm-all.jar directly in the classpath didn't help. Building jar-with-dependencies

How to put classes for javaagent in the classpath

瘦欲@ 提交于 2020-01-10 18:22:07
问题 I am trying to develop a javaagent that would instrument code with help of asm-4. For now I'm stucked with a pretty basic problem, the classloader for the javaagent doesn't see asm dependencies and therefor fails. Do I have to provide a jar-with-dependencies (aka maven build plugin) which contains all the needed classes by the agent, or is there another way to add classes to the java agent? Referencing the jar asm-all.jar directly in the classpath didn't help. Building jar-with-dependencies

What is the difference between “classpath:” and “classpath:/” in Spring XML?

丶灬走出姿态 提交于 2020-01-10 13:04:36
问题 I am working on some Spring XML configuration files and sometimes they use "classpath:/datasource.xml" and sometimes "classpath:datasource.xml" . Is there a difference between the two or is the leading / optional / implied / redundant? 回答1: I don't see any difference between these two. The biggest difference that you will see is that the relative path and the * on the classpath location Here is an excerpt from Spring Resources, look for section 4.7.2.2 Classpath*: The "classpath*:" prefix can

Adding database drivers to use WEKA classes

孤街浪徒 提交于 2020-01-10 04:18:05
问题 I tried to run the following command on the command-line: G:\Weka-3-6>java weka.core.converters.CSVLoader data.csv > data.arff This is the error message: ---Registering Weka Editors--- Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH? Trying to add database driver (JDBC): com.mckoi.JDBCDriver -

What exactly is a class path in java?

对着背影说爱祢 提交于 2020-01-09 10:41:49
问题 I wrote a program that works on my laptop perfectly, but I really want it to work on a server that I have. Using NetBeans , I've clean and built the project. I copied the contents of the folder dist on my server but I cannot seem to get to work by using command java -jar nameOfFile.jar I get the error java.lang.NoClassDefFoundError: org/.... I have been doing some reading and from what I gather is that I need to pretty much specify where the libraries that I've used are located. Well they are

What exactly is a class path in java?

試著忘記壹切 提交于 2020-01-09 10:41:47
问题 I wrote a program that works on my laptop perfectly, but I really want it to work on a server that I have. Using NetBeans , I've clean and built the project. I copied the contents of the folder dist on my server but I cannot seem to get to work by using command java -jar nameOfFile.jar I get the error java.lang.NoClassDefFoundError: org/.... I have been doing some reading and from what I gather is that I need to pretty much specify where the libraries that I've used are located. Well they are

Getting Ant <javac> to recognise a classpath

依然范特西╮ 提交于 2020-01-09 02:14:05
问题 I have an Apache Ant build file with a <javac> command that requires four specific JARs to be on the build classpath . I've tried to do this: <project basedir=".." default="build_to_jar" name="Transnet Spectrum Analyzer"> <property environment="env"/> <property name="src" value="src"/> <property name="libsrc" value="library_sources" /> <property name="build" value="build"/> <property name="dist" value="dist"/> <property name="target" value="1.5"/> <property name="libraries" value="./libraries

Spring autowire stops working for classes on the Tomcat classpath

丶灬走出姿态 提交于 2020-01-07 04:03:06
问题 Inside my library FooLibrary.jar Spring instantiates class com.example.FooImpl which has a property bars . I have lots of Bar instances also instantiated by Spring. A set of bars is autowired into FooImpl like this: @Component public class FooImpl { @Inject private Set<Bar> bars; In a standalone application, Spring instantiates the Bar instances, instantiates the FooImpl instances, and then autowires FooImpl.bars with the set of Bar s. It works. Now I'm running the same Spring configuration

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

纵饮孤独 提交于 2020-01-07 02:18:41
问题 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