classpath

Method to dump classes on the classpath from inside JVM?

帅比萌擦擦* 提交于 2019-12-03 17:24:31
My code is failing with a ClassNotFoundException . I can see that the jar file containing the class is definitely on the classpath from the command prompt execution. Is there a way to dump the list of classes on the classpath from the JVM? (Ideally some Java code). (I don't want to see the classes in a directory, I want to see a list of what is loaded into the JVM). That's actually not what you want to see if you're getting a CNFE , since it's not found. Plus not all available classes will be loaded at any given time. Start by going through this list . But in general, if it's not found, it's

Javac vs Java within -classpath option

别说谁变了你拦得住时间么 提交于 2019-12-03 17:03:31
问题 What is the difference in calling the -classpath option from javac and from java for example: javac -classpath MyJar.jar GetJar.java java -classpath MyJar.jar:. GetJar it works as well as: javac -classpath MyJar.jar GetJar.java java GetJar So basically where the first -classpath related to javac needs to be there, on the other hand in the java command line it might be optional. Why? Do you know in which circumstance it would be mandatory. And more in general what is the effect of -classpath

Cannot find class even when jar file is in working directory

為{幸葍}努か 提交于 2019-12-03 16:53:05
I am struggling to get my Java program to run on AIX. I used Eclipse on Windows to create a runnable Jar file, jRams.jar below. I kept on getting a class not found error, until finally I put all the external libraries in the same directory. $ ls JAXB2_20081030.jar JAXB2_20110601.jar activation.jar asjava.jar commons-beanutils-1.8.3.jar commons-beanutils-bean-collections-1.8.3.jar commons-beanutils-core-1.8.3.jar commons-codec-1.5.jar commons-collections-3.2.1.jar commons-configuration-1.6.jar commons-digester-2.1.jar commons-jxpath-1.3.jar commons-lang-2.6.jar commons-logging-1.1.1.jar commons

How to add configuration file to classpath of all Spark executors in Spark 1.2.0?

和自甴很熟 提交于 2019-12-03 16:29:56
问题 I'm using Typesafe Config, https://github.com/typesafehub/config, to parameterize a Spark job running in yarn-cluster mode with a configuration file. The default behavior of Typesafe Config is to search the classpath for resources with names matching a regex and to load them into your configuration class automatically with ConfigFactory.load() (for our purposes, assume the file it looks for is called application.conf ). I am able to load the configuration file into the driver using --driver

Eclipse: find resource on classpath

百般思念 提交于 2019-12-03 16:21:34
Is there a way in eclipse to search the classpath for arbitrary resource file names (or patterns)? I know I can use either Navigate > Open Type (which will scan the classpath for classes) or Navigate > Open Resource , which will search for any resource type, but only in my project folders. Is there any way to achieve a combination ob both, to do a resource search (something like *.xsd ) that searches all jars on the classpath? The classpath helper plugin is at least a starting point. Looks like it doesn't provide a search but it seems to list all entries on the classpath. I don't know if your

Adding .jar's to classpath (Scala)

﹥>﹥吖頭↗ 提交于 2019-12-03 15:06:27
问题 So I've been trying to work with the signal-collect framework and I downloaded the .jar files and extracted it into a folder. Currently the folder structure looks like: LICENSE.txt PageRank.scala core-1.1.1-sources.jar dependencies/ javaapi-1.1.1-sources.jar NOTICE.txt README.txt core-1.1.1.jar javaapi-1.1.1-javadoc.jar javaapi-1.1.1.jar Where PageRank.scala is the Scala test code they provide, which is: import com.signalcollect._ object PageRank extends App { val graph = GraphBuilder.build

Add user libraries to Ant Builder classpath

﹥>﹥吖頭↗ 提交于 2019-12-03 13:16:17
I am having a problem with setting up an Ant Builder for my Eclipse projects. I do have several 3rd party libs configured as user libraries within Eclipse. Those libraries are added to the build path of my projects and everything is working fine. My problem is, that if I want to use the Ant Builder from Eclipse, I will have to add some of the user libraries to the classpath of the Ant Builder to get it working. I need those Libs because they include several task defs and type defs for Ant, NOT TO COMPILE MY PROJECTS. But how can I add those user libraries to the Ant Builder classpath? I don't

Calling java with wildcards in classpath fails

五迷三道 提交于 2019-12-03 12:53:26
I have some jars in the current directory, all needing to be in the class path, so I want to use the wildcards convention for classpath. The command line is: java.exe -classpath * org.python.util.jython args However I get this error Exception in thread "main" java.lang.NoClassDefFoundError: G:/repo/builds/jars/edu_mines_jtk/jar Caused by: java.lang.ClassNotFoundException: G:.repo.builds.jars.edu_mines_jtk.jar 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

How does a classloader load classes reference in the manifest classpath?

折月煮酒 提交于 2019-12-03 12:50:26
I used maven to built a jar with an external classpath additions using addClasspath . When I run that jar using java -jar artifact.jar it is able to load classes from that main jar and from all jars in the libs directory. However if I ask the system property java.class.path it will only list the main jar. If I ask the system class loader for its urls ( ClassLoader.getSystemClassLoader().getURLs() ) it will also only return the main jar. If I ask any class contained in some library for its class loader it will return the system class loader. How is the system class loader able to load those

How to install jar library?

半城伤御伤魂 提交于 2019-12-03 12:33:08
I've downloaded the ANTLR Java runtime libraries. It's a jar file. It contains "org.antlr.runtime". Where do I put it so that the Java compiler can find it? Do I need to extract it? I'm using NetBeans (for now), if relevant. For NetBeans you go to your Projects Tab and then right-click on the project you want the library added to then click Properties. Go to the Libraries bullet then on the right side click on Add JAR/Folder. No need to extract it. All you have to do is right click in the editor window and click Fix Imports. For use outside of NetBeans you have to add it to your Java classpath