由买买提看人间百态

topics

全部话题 - 话题: classpath
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)
k***r
发帖数: 4260
1
If you have control over how the smtp server is started, then you can write
your own code to start it (in a separate thread), and also write your own
code to start the embedded web server.
If the smtp server is configurable, it must have some API exposed. Call them
from your web server URL handlers.
For the web server, check out winstone. It's the smallest applet container
in the world and probably also the easiest to use for embedded usage. Just
include the jar in the classpath and call it from
t*******t
发帖数: 105
2
来自主题: Java版 - 问个eclipse的问题
我写了一个testclass叫做TestClass.java
package com.test1;
class TestClass{}
javac ....
然后建立如下文件夹:
com\test1\TestClass.class
然后
jar cvf d:\test1.jar d:\com\test1\*.*
得到一个包。
进入eclipse,随便找个class,再随便找个method
写:
TestClass tc = new TestClass();
提示说找不到,于是 project-》properties-》build path,添加test1.jar,
然后
import com.test1;
eclipse说找不到 com。test1.
我随后查看了。classpath文件,
其中有:

但是后来我把
com\test1\TestClass.class
直接拷贝到 src 文件夹,eclipse就找到了。
哪位大侠能解释一下吗?难道是我的jar file生成的
c*******o
发帖数: 1722
3
来自主题: Java版 - 问个run java file 的问题
i have a java file pax.jar and a lib file PDFBox.jar.
i use the command line to run pax.jar
java -cp PathForPDFBox -jar pax.jar
报错说找不到一些class的定义,那些class是在pdfbox.jar里面定义的。
这是为什么?我已经给出了pdfbox.jar的路径。
我也试着用
java -classpath PathForPDFBox
java -jar pax.jar
还是同样的错误。
thanks for help.
g*****g
发帖数: 34805
4
来自主题: Java版 - 问个run java file 的问题
java -classpath pax.jar;PDFBox.jar yourMainClass
g*****g
发帖数: 34805
5
来自主题: Java版 - 问个run java file 的问题
use : as classpath separator on linux machine, and you may
need to make files excutable.
Z****e
发帖数: 2999
6
来自主题: Java版 - 问个run java file 的问题
when you use -jar option, the -classpath will be overriden by whatever is
set in pax.jar
M***D
发帖数: 478
7
来自主题: Java版 - 能这样编网站吗?
a webserver includes java sdk, tomcat,apache, perl, php, oracle.
its os is UNIX.
now I can use shell to log in to compile java and run it.
but I don't like shell. it is too slow.
My computer is vista which installed eclipse, but no java sdk and others.
Can I use the eclipse in my computer and write and debug code stored
in the UNIX? How to set the classpath?
What is this technology called?
c**o
发帖数: 186
8
来自主题: Java版 - question java command
I have a command like this,
EXECCMD="${XTERMCMD} ${JAVA_HOME}/bin/java -classpath ${GCLASSPATH} ... ${
EXECLASS} $*"
I don't know what it is $*.
it will be run on linux os.
Thanks.
k*********e
发帖数: 2039
9
来自主题: Java版 - 新手求助applet问题
既然netbean里面能运行,ie,或者appletview不行,我琢磨着是哪里没有设置好。
因为网上找的一些例子,down下来,我自己运行的时候,也出现这样的问题。
应该不是程序的问题,不过classpath我也是按照常规去设置的,也没有忘加那个.。
g*****g
发帖数: 34805
10
来自主题: Java版 - Complaint about Java class package
We all know why we need package name, to make classes unique and
avoid confliction as much as possible.
Now package info is meta data or you can consider it part of class
name and you certainly don't want it to get lost in transportation.
Now consider your proposal, let's remove 1 and count on 2 to determine
pacakge name.
If you have a class under abc directory, and you classpath contains
both the root and abc directory, what's gonna be the class name?
abc.xxx or xxx?
On the other hand, 2 can be
k***r
发帖数: 4260
11
来自主题: Java版 - Complaint about Java class package

A decision needs to be made here. The decision can be one of these:
1. both are fine (both abc.xxx and xxx)
2. the first (whichever is declared in classpath first)
3. the deepest (abc.xxx)
4. the shallowest (xxx)
And I think #1 makes most sense. You can address a class like
that either way. Then again, having class path to a sub directory
may not be a good idea in the first place.
So overall I don't see any obstacles removing "package" from
classes.
This is definitely messy so I'm not suggestin
g*****g
发帖数: 34805
12
来自主题: Java版 - eclipse debug function question
project Properties =>libraries
Or you can simple edit your .classpath file
h*****0
发帖数: 4889
13
来自主题: Java版 - build.xml
是不是这样写,原来的classpath就没了,比如其实的库

/d
C**********r
发帖数: 75
14
Our server has different versions of Xerces-J installed, from 1.9 to 2.8
My project has to use Xerces-J 2.8 and I have Xerces-J.2.8.jar under my
project /WEB-INF/lib
How can I make my project invoke /WEB-INF/lib/ 2Xerces-J.2.8.jar without
changing system's classpath?
g*****g
发帖数: 34805
15
I think you are confused with relative path. For path
used in web app, normally you have 2 choices.
1. Pass in a root web app directory as a property to the app
2. Use classpath resource and keep your files in $App/classes
That way, you achieve portability.
q*********u
发帖数: 280
16
能不能干脆继承了,然后再在自己继承的类下面写xml配置
如果把类路径写全,应该不会有问题的,你的package不知道是不是在正确的classpath
下面





column="personID"
class="com.company.pack1.Person"/>
错误出在 class="com.company.pack1.Person", 我如果吧person放在data package,
class="Person", it will work. 但我想map到另外一个package的Personl Class, 怎
么设置。。
谢谢了
s*********g
发帖数: 2350
17
来自主题: Java版 - Eclipse 编译求助
很菜的关于package 的问题, 请大家不要耻笑啊。。。
编译文件 A.java 需要用到 文件B.java中的class "MyClass"
文件B的目录是 D:\Programming\JavaBook\ThinkingInJava\TIJ4-code\access\
mypackage
文件B.java的第一行是
package access.mypackage;
文件A.java的第一行是
import access.mypackage.*;
我是这麽设置CLASSPATH的
右键点击project 的property, 选 Java Build Path-->Libraries-->Add Variable
s*********g
发帖数: 2350
18
来自主题: Java版 - Eclipse 编译求助
谢谢指正。 B.java里面确实是要被调用的 class B。
就是感觉不知道怎么用CLASSPATH. 比如想用网上别人的class, 难道也得下载到自己的
本地目录里才能用?

folder.
g*****g
发帖数: 34805
19
来自主题: Java版 - Eclipse 编译求助
For third party jar or unbundled classes,
use add external jars and add external class folder respectively.
It's all common for ant users to copy all libs in a lib folder
in the project.

者.
CLASSPATH
m******t
发帖数: 2416
20
来自主题: Java版 - Eclipse 编译求助
I would recommend that you start with compiling and running
at least one project entirely from command line. It'd help
you understand how the Java source tree and classpath work,
without all the distractions and hand-holding from an IDE.
Once you get past that, you'll find lots of things in Eclipse
actually quite intuitive.
s*********g
发帖数: 2350
21
来自主题: Java版 - Eclipse 编译求助
Thanks.
我就是对Java source tree 和classpath不清楚。
我现在用import-->File system把我需要的.java file都加到一个Project里面了。这
些 code好像现在都可以运行了, 他们在这个Project下面的目录结构正好跟每个we文件
开头的package路径是一样的。
下面有时间用用commmand line编译。
谢谢楼上各位了。
m****r
发帖数: 6639
22
来自主题: Java版 - 问个spring问题
我有两个context, 一个用
class="org.springframework.beans.factory.config.
PropertyPlaceholderCon
figurer">


classpath:my.properties



另外一个用:



dbProps ... 阅读全帖
g*****g
发帖数: 34805
23
来自主题: Java版 - 找不到HttpClient Class
Make sure commons logging jar is in classpath.
l*********s
发帖数: 5409
24
来自主题: Java版 - classpath 和 lib/ext 的区别?
Thank you, realBull!
m*****k
发帖数: 731
25
来自主题: Java版 - classpath 和 lib/ext 的区别?
maybe some class conflicting, such as what you need is xxx.class ver 3 in
beanutil.jar while some other jar contains xxx.class ver2 .
S****h
发帖数: 558
26
来自主题: Java版 - classpath 和 lib/ext 的区别?
Common log use other library (log4J for example) to do the real log job. It
searches certain folder for a logger library and search rules are quite
complicated. So I guess it might be important to sit in CORRECT place. I
think that is one reason lots of new library try to dump it for other log
facade.
o****i
发帖数: 1706
27
【 以下文字转载自 Programming 讨论区 】
发信人: ouyadi (可乐会捂帮帮众), 信区: Programming
标 题: Java代码,老是compile出错,大家帮我看看哪错了。。。
发信站: BBS 未名空间站 (Wed Apr 27 16:58:23 2011, 美东)
我在git上push到学校的服务器后编译老是不通过,错误如下,麻烦大家帮我查下原因
,谢谢啦!
javac -classpath /usr/share/junit/lib/junit.jar -d classes -sourcepath .
Iterator.java List.java TestUpTree.java UpTree.java
UpTree.java:34: type Iterator does not take parameters
public class NIterator implements Iterator{
^
UpTree.java:104: type Iterator does not take parameters
pub... 阅读全帖
c******n
发帖数: 4965
28
来自主题: Java版 - what is your opinion in this case?
/* generate a bunch of "random" numbers
taken in serial one by one from a list of numbers in
a given file
*/
class RandomGen(
public RandomGen() throws IOException {
InputStream ios = ..... open "rand.txt" in CLASSPATH;
//
read the file into memory,
}

int idx;
public Integer gen() {
return list_of_numbers[idx++];
}
}
something like the above.
the problem is that the constructor throws IOException, so if I use this
class, and most likely I us... 阅读全帖
p*********t
发帖数: 2690
29
你是不是在说spring,hibernate这类比较高级的东东?
有人跟我说,java最难的是classpath,哈哈。
w**z
发帖数: 8232
30
来自主题: Java版 - Eclipse and java 1.6
classpath Variables
and
Java -> Installed JREs
d******y
发帖数: 244
31
Thanks. I download the apache-log4j-1.2.16 and add to classpath.
nothing happens.
c******n
发帖数: 4965
32
In a Java project in Eclipse, I am trying to debug project A.
Project A has a dependency on B.jar, normally B.jar comes from my .m2/
repository. but now I want to make some temp changes to B's code, and have
it reflected in A, so I directly edit the source code in B project in
eclipse, and set B as a dependency project in A's build path. Additionally,
both A and B refer to C.jar as their dependencies.
This builds A fine, but when it is run, A's classpath contains 2 copies of
all the classes and ... 阅读全帖
g*****g
发帖数: 34805
33
First of all, most of the time you don't put 3rd party libs into
your own jar. You leave them and put all of them in the classpath.
Now if you really want to do it, you should use something like Ant
or Maven that you can have different targets.
y****e
发帖数: 1012
34
来自主题: Java版 - UnsatisfiedLinkError
在一个机器上写一个jar,用eclipse配置了native library~但是在另外一个机器上却跑
不了……
/usr/lib/jvm/jdk1.7.0/bin/java -Djava.library.path=./lib -Dfile.encoding=UT
F-8 -classpath ./target/classes:./lib/gdata-core-1.0.jar:./lib/gdata-client-
1.0.jar:./lib/gdata-maps-2.0.jar:./lib/gdata-media-1.0.jar:./lib/lpsolve55j.
jar:./target/DCPlacement-jar-with-dependencies.jar:/usr/share/java/log4j-1.2
.jar DatacenterLocator -g 10,10 -l 4000 -s heuristic
报错:
Exception in thread "Thread-3" Exception in thread "Thread-0" Exception in t
h... 阅读全帖
y****e
发帖数: 1012
35
tomcat7 2888 1 2 20:26 ? 00:00:19 /usr/lib/jvm/jdk1.7.0_03/bin
/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.
properties -Djava.library.path=/ssd_back/workspace/CDPlacement/
DCPlacementCore/lib -Djava.awt.headless=true -Xmx128m -XX:+
UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.
ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -
classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat
-juli.jar -Dcata... 阅读全帖
z****n
发帖数: 1933
36
来自主题: Java版 - 请教一个spring的问题
定义一个接口
public interface DataAccessDao
实现
public class DataAccessDaoImpl implements DataAccessDao
单元测试
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring/DataAccessTest.xml")
public class DataAccessTest
{
@Autowired
private DataAccessDaoImpl dataAccessDao;
spring配置

然后出错, org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean o... 阅读全帖
z****e
发帖数: 54598
37
来自主题: Java版 - 说说spring和ejb的差别
我个人觉得
tier划分清晰
对于整个系统的扩展以及将来跟其它系统做集成
有很重要的关系
所以强调web service
因为基于web service
发展出了很多理论,或者说构架
比如esb,比如bpel
这都是基于web service的实现
当然也支持有其它技术,但是相对少
所以层次之间的通信协议,是一个大topic
不同层次,用什么通信都有可能,但是趋势是xml的大统一
也就是将来不管跟什么系统搞,对方极有可能要求你发xml
同时会给你发一个xml文档
xml之后发明的绝大部分协议,都是xml的扩展
所以应该主动拥抱xml,拥抱web service
的确,这种tier通过这种方式连接,是一种比较松散的连接
但是松散的连接正是我所期望的,我认为一个好的分布式操作系统
就应该实现这种像组件一样,少了谁,系统一样转
同时来者不拒,只要愿意加入,系统就能接纳
这样才是一个健康或者说健壮的系统
比如说,我要设计一个系统
我还是首选用ejb做核心,提供主要的web service
剥离database上所有的业务逻辑要求,因为db本身负担已经很重了
随着系统规模的增加,db里面数据量一... 阅读全帖
S****h
发帖数: 558
38
add them into your classpath.
T****U
发帖数: 3344
39
try change it to
/home/jnsong/Downloads/htmlunit-2.11/lib/*
or use
javac -cp /home/jnsong/Downloads/htmlunit-2.11/lib/* yourprogram
j******3
发帖数: 299
40
我把路径末尾的".jar"去掉了,
现在再编译myClient.java 提示是这样:
jnsong@ubuntu:~$ javac myClient.java
myClient.java:13: error: cannot find symbol
HtmlPage page = webClient.getPage("http://google.com"); // Pass in URL
^
symbol: class HtmlPage
location: class myClient
1 error
如果直接用你说的第二种方法,提示:
jnsong@ubuntu:~$ javac -cp /home/jnsong/Downloads/htmlunit-2.11/lib/*
myClient.java
javac: invalid flag: /home/jnsong/Downloads/htmlunit-2.11/lib/commons-
collections-3.2.1.jar
Usage: javac 阅读全帖
T****U
发帖数: 3344
41
在.java里面加
import com.gargoylesoftware.htmlunit.html
or
import com.gargoylesoftware.htmlunit.*
你如果不熟java和linux的话,最好先在windows下用eclipse或其他IDE编译通过后再上
linux
j******3
发帖数: 299
42
ThinkU,谢谢你的帮助,我那个问题已经解决了,就是你说的,import的时候用*,就不
报错了。我还在继续学习中。感谢!
c*********e
发帖数: 16335
43
来自主题: Java版 - 初学 Java 的神器 - Eclipse
ide好用多了,生成jar文件,非常容易。用shell,经常要设置classpath,非常闹心。

How
Java
e******t
发帖数: 157
44
来自主题: Java版 - 新手问题
LZ看的是ORACLE网站上的教学材料. 在package部分有个例子. LZ吭吃吭吃该了
CLASSPATH什么的终于编译通过了, 试着运行了一下, SERVER可以运行, CLIENT说没有
MAIN什么的, 牛牛们帮忙看一下, 这程序能运行吗?
1)server.java
package mygame.server;
import java.io.*;
import java.net.*;
import mygame.client.Client;
import mygame.shared.Utilities;
public class Server {
public static void main(String args[]) {
ServerSocket serverSocket = null;
Utilities.printMsg("creating server socket");

try {
serverSocket = new ServerSocket(4444);
} catch (IOExceptio... 阅读全帖
S*******h
发帖数: 7021
45
在Eclipse里写了一个HelloWord program. 用了Assert statement. Tutorial说需要
先run java -ea command 去enable assert
public class HellowWorld {
public static void main(String[] args) {
int x = 5;
int y = 7;
assert (x > y): "stuff";
System.out.println("passed");
}
}
1. java -ea HelloWorld 只能在command line console 底下跑吗? 有没有办法让它
在 Eclipse->Run application 前 在Eclipse里 run 这command?
2. 在command line console 里试了 C:\workspace\Test\src> java -ea HelloWorld
结果返回 "could not find the main class HelloW... 阅读全帖
g*****g
发帖数: 34805
46
来自主题: Java版 - spring到底有什么好处?
I think spring came with AOP and things like JDBCTemplate and some good
utilities (String manipulation, loading resource from classpath etc.) even
in early days.
And there's no other good AOP solution at that time. It's more than IoC.

用它
x*****g
发帖数: 764
47
来自主题: Java版 - java inner class - 初学者问
写了个小程序,一个class中内嵌了几个inner classes. 举个例子,在A class中有一
个inner class B. 在eclipse 里面运行没有任何问题。现在改用命令行运行,但是总
是显示找不到那个inner class,说那个inner class B不存在。我可能整个就不知道怎
么用命令行运行java 程序 (也就是这本身不是个问题),或者是我classpath设的不
对,请大侠们指教一下。先谢谢了。
g*****g
发帖数: 34805
48
来自主题: Java版 - java inner class - 初学者问
你这个命令行inner class不存在,可能跟inner class没有啥关系。就是classpath没
设对。
先从helloworld开始试吧,别上来就inner class。
x*****g
发帖数: 764
49
来自主题: Java版 - java inner class - 初学者问
我的和你的是一个情况,这个inner class 就是一个button panel而已。前面有人讲可
能classpath不对,我也怀疑如此,但是那个含有inner class的class是能够找到的。
error message就是说那个inner class不存在。前面还有人说该从"hello world"开始
。这么说吧,我的第一个"hello world"程序是在1990年编的,java hello world可能
也是7,8nian前的事了吧。不知道说明白了没有。我是没有太多时间去试,就上来问问
想省点时间,因为这里高手多,我毕竟还是个“初学者”吧。
c*********e
发帖数: 16335
50
来自主题: Java版 - java inner class - 初学者问
可以试试把那2 classes(大class以及它的inner class)做成jar文件,在classpath里
加入这个jar文件,就象加library那样,不過我没试过,就是一想法。
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)