classpath

Building ClassPath variable in Manifest file with Eclipse

这一生的挚爱 提交于 2019-12-22 04:43:53
问题 Is there a way for Eclipse to output all the Jars I would like to define on my ClassPath variable in the Manifest when exporting a project as a jar? I would like to be able to just click on all the jars I need my project to depend on, and then have Eclipse output it all like: ClassPath: . /lib/somejar.jar /lib/otherjar.jar Thanks 回答1: Yes, there is: Eclipse > File > Export > Java > Runnable JAR File > "Copy required libraries into a sub-folder next to the generated JAR" . It will create a

help with ant file - classpath for Java task

你离开我真会死。 提交于 2019-12-22 04:28:19
问题 I have the below build file for Ant and trying to use the target 'run' for executing the program. <property name="springjar" location="E:/Tools/spring-30/dist/" /> <property name="logjar" location="E:/Tools/commons-logging-1.1.1/" /> <patternset id="jar.files"><include name="**/*.jar"/></patternset> <path id="springlearn.classpath"> <fileset dir="${springjar}"><patternset refid="jar.files"/></fileset> <fileset dir="${logjar}"><patternset refid="jar.files"/></fileset> </path> <target name="run

The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app

烂漫一生 提交于 2019-12-22 04:20:22
问题 This issue occurs when updating the dependencies classpath from 'com.android.tools.build:gradle:3.2.1' to *'com.android.tools.build:gradle:3.3.2' project-level build.gradle buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.3.2' } } allprojects { repositories { google() jcenter() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn('

Use Absolute path for ClassLoader getResourceAsStream()

谁说我不能喝 提交于 2019-12-22 04:05:25
问题 I am trying to use ClassLoader getResourceAsStream() My Direcory structure is like below: Project1 -src -main -java -webapp -WEB-INF -MYLOC -someprops.properties For classloader.getResourceAsStream("MYLOC/someprops.properties") works fine. But now I have to move the properties file outside of the .war, like in C:\someprops.properties But, classloader.getResourceAsStream("C:\someprops.properties") does not work. Can it not use an absolute path? 回答1: If you have a native file path then you don

load class file from classpath

流过昼夜 提交于 2019-12-21 23:12:09
问题 I want to load class files from module dependencies (external jar files in the classpath). When I tried getResourceAsStream I got null pointer exception: ClassParser parser = new ClassParser(this.getClass().getResourceAsStream("org/apache/tools/ant/taskdefs/optional/net/FTP.class"), "FTP.class"); Exception in thread "main" java.lang.NullPointerException at com.sun.org.apache.bcel.internal.classfile.ClassParser.<init>(ClassParser.java:101) at ParaNamesTest.printUtilsParNames(ParaNamesTest.java

How can I make Ant use JAXB 2.2.x instead of Java 6 SE JAXB classes in javac?

谁说胖子不能爱 提交于 2019-12-21 21:37:12
问题 I'm in the process of updating a legacy application to use Java 6 SE instead of Java 5 SE. The app uses JAXB, and under Java 5 SE it have the JAXB reference implementation jars on the classpath. When I moved to Java 6 SE (update 38), I hit a few bumps (see linked Stackoverflow question) that I resolved with some help. So the next thing that is causing trouble is the project Ant build script. When the Ant compile task executes, it picks up the embedded version of JAXB that comes with Java 6 SE

How to access Jar file located within source folders?

故事扮演 提交于 2019-12-21 21:01:25
问题 in my Java project I am using an H2 in-memory database, for which I have to load the JDBC driver when I initialize my application. I want/need to load the H2 .jar file dynamically, so I do the following: String classname = "org.h2.Driver"; URL u = new URL("jar:file:libs/h2.jar!/"); URLClassLoader ucl = new URLClassLoader(new URL[] { u }); Driver d = (Driver) Class.forName(classname, true, ucl).newInstance(); DriverManager.registerDriver(new DriverShim(d)); When I put the H2 .jar file into a

How to override ant task stored in ant lib directory

冷暖自知 提交于 2019-12-21 19:53:50
问题 At my work we use AspectJ in some of our Java projects. To get this to work with ant builds we have been placing aspectjtools.jar within ant/lib/. I am now working on a particular Java project and need to use a newer version of aspectJ. I don't want to have to get everyone who uses the project to update their local copy of aspectjtools.jar. Instead, I tried adding the newer aspectjtools.jar to the lib directory of the project and adding the following line to build.xml. <taskdef resource="org

access common property file inside bundle with osgi

╄→尐↘猪︶ㄣ 提交于 2019-12-21 19:52:57
问题 I have an osgi application (in felix) with multiple bundles. There are some common property files in one bundle and the rest of the bundles need just use them. We use maven and spring osgi, the property files are in resouces like: <path to bundle>/src/main/resources/ common.properties engine.properties ... Maven builds them inside the bundle jar normally so they should be in an application classpath, but Spring has no access to them, this fails: <context:property-placeholder location=

How to parse and interpret ant's build.xml

﹥>﹥吖頭↗ 提交于 2019-12-21 17:58:11
问题 Is there an Ant API for reading and ant build.xml and retrieving elements from it? Specifically I want to be able to retrieve the values in a path element and be able to walk all of the elements in the path. My purpose is to retrieve a given path and ensure that it is referenced correctly in a manifest, so that the build and the manifest match when the product goes out to production. EDIT: Regarding the responses (and thank you for them) to use an XML API, the problem is that the build file