classpath

What does a single Dot (“.”) in Distribution Manifest.mf mean?

无人久伴 提交于 2019-12-11 02:58:50
问题 lately I got a bit confused concerning class-pathes in Manifest.mf-files. So what I want is to outsource some properties.files out of my distribution.jar and put them next to it without changing java-source-files. Following example: At this time I can open a properties-file like this: this.getClass().getClassLoader().getRessourceAsStream( "/config/jdbc.properties" ); The jdbc.properties are located in an eclipse sourcefolder called 'resources' with a package named 'config'. Now when I build

Compiling a Servlet in Ubuntu returns errors

陌路散爱 提交于 2019-12-11 02:57:39
问题 I am attempting to compile source code to be used in a webapp. I know things in Ubuntu are not like things in Windows and that setting classpath permanently is not a good thing to do so I decided to set the flag temporarily. Here is my command in terminal: littlejavachild@ubuntu:~/LittleJavaChild/ServletProjects/beerV1$ javac -cp "/usr/share/tomcat7/servlet-api.jar" -d classes src/com/example/*.java What I am trying to achieve is: compile all the .java files in the package com.example send

java “Class file contains wrong class” error

陌路散爱 提交于 2019-12-11 02:54:37
问题 I'm trying to make a console application to test my webservice. I successfully deployed a webservice at http://localhost:8080/WS/myWS and i made proxy classes with wsimport: wsimport -d bin -s src http://localhost:8080/WS/myWS?wsdl Now my webservice classes are located in bin/mywebservice/ and i'm trying to compile my client class with classpath = ./ Here's the source code of my class: import bin.mywebservice.myClass_Service; public class TesterApp{ public static void main (String args[]) {

Why is javac's -cp option case sensitive, but java's -cp option not?

妖精的绣舞 提交于 2019-12-11 02:49:45
问题 I've noticed that case sensitivity for javac and java options seem to vary. For instance: Case sensitive javac command option? -cp Yes -sourcepath Yes -d No Case sensitive java command option? -cp No As an example of case sensitivity for these four options, take the following folder structure: project \ src \ Main.java \ subf \ Sub.java \ bin \ Main.class \ subf \ Sub.class Main.java, which shows the Sub class being used - class Main { public static void main(String[] args) { subf.Sub.method(

javac -classpath not doing the trick

流过昼夜 提交于 2019-12-11 02:47:05
问题 I have a source file SerialTalk.java, in directory C:\javasrc\BattProj This file imports classes from RXTXcomm.jar, eg. import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; ... RXTXcomm.jar is in the same directory as SerialTalk.java. I compile specifying a classpath pointing to the current directory: javac -verbose -classpath . SerialTalk.java Invariably, I get the following error. (Actually, many instances & variants of this error): SerialTalk.java:3: error: package gnu.io does not

java version still showing as 1.4 linux

我怕爱的太早我们不能终老 提交于 2019-12-11 02:09:32
问题 java -version still returns old java version. I have red hat linux I installed jdk 1.5 int eh follwing path and updated the bask profile and did a source but still the java version shows 1.4 JAVA_HOME=/usr/local/jdk/jdk1.5.0_10/bin/java PATH has /usr/local/jdk/jdk1.5.0_10/bin but i still see java -version even from the bin directory /usr/local/jdk/jdk1.5.0_10/bin as follows java -version java version "1.4.2" gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10.0.1) Copyright (C) 2006 Free Software

Reading file from classpath location for “current project”

孤街醉人 提交于 2019-12-11 01:34:24
问题 i have 2 projects A and B in eclipse. B has dependency to A. In project A is a text file "file.txt" . This file can be loaded in project B by for example getClass().getResourceAsStream(...) ... because the location of the file is in classpath . I want to provide this same file name in project B and do some action only if file exists in project B. If there is no file in project B then no file should be found during loading with getClass().getResourceAsStream(...) . Currently the file will be

IntelliJ IDEA: How can I make sources of dependent libraries to be available in classpath on compilation?

社会主义新天地 提交于 2019-12-11 00:22:35
问题 How can I make sources of dependent libraries to be available in classpath on compilation ? I'm using IntelliJ IDEA 11. When I add Global Library to module and artifact IDE never copies sources and javadocs. That makes sense because they are not needed in runtime. But I need them in compile time. Interestingly though IDEA makes sources available if I add dependency as folder. I guess in this case it doesn't differentiate what sits in that folder. Odd. Thoughts ? 回答1: i solved this issue in

Adding a resource directory to classpath of greety (Gradle Plugin)

前提是你 提交于 2019-12-11 00:09:35
问题 I'm trying to run gradle with the plugin gretty using jetty . The problem is the gretty plugin does put the directory src/test/resources on the classpath and I need a lazy load for some .properties files on the Jetty startup. dependencies { gretty "com.zaxxer:HikariCP:${version_hikaricp}" gretty "org.hsqldb:hsqldb:${version_hsqldb}" gretty files("target/classes/main", "target/resources/main", "src/test/resources") } The code above is not loading the resources to the classpath to be used by

Problem deserializing objects from cache on MyBatis 3/Java

人盡茶涼 提交于 2019-12-10 23:37:42
问题 So I'm working on a side project using MySQL/MyBatis3/Tomcat. I'm currently working on turning on caching in MyBatis. When I first tried to turn on caching, I got exceptions due to the fact that my object didn't implement Serializable. So, after implementing Serializable with the object I was trying to cache; it appeared to cache fine. But; when I hit my servlet a second time with the same situation, and the object mapper attempts to deserialize my object from the cache, I get the following