由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - CLASSPATH问题
相关主题
eclipse下生成的jar file不包含libraryRe: 奇怪?? import找不到package
[合集] How to remove absolute path in eclipse project fileRe: JDE1.2.2 Standard version下如何找classpath的?
Re: How to compile a Java program with import my own package in UNIXRe: java web server help!!!
jre classpathRe: 怎样递归操作目录,子目录以及他们下面的文件?
Unix: where to execute java program?使用JAVA的一则经验和教训
能这样编网站吗?Re: Where can i find this package?
Re: file permissions when using java creating filesMastering the classpath with JWhich
one way to show result windows while using VJ++.net vs. J2ee(zhuan)
相关话题的讨论汇总
话题: classpath话题: java话题: javat话题: doc话题: list
进入Java版参与讨论
1 (共1页)
g****o
发帖数: 1284
1
Thinking in Java的第5章讲了如何创建自己的package,里面提到了一个CLASSPATH环境
变量。书里给了一个例子:
//:List.java
// Creating a package
package com.bruceekel.util;
public class List {
public List() {
System.out.println("com.bruceeckel.util.List");
}
}
然后作者说把生成的类文件放在他自己系统的一个子目录下:
C:\DOC\JavaT\com\bruceeckel\util
在他的机器上,CLASSPATH = .; D:\JAVA\LIB; C:\DOC\JavaT
请问在UNIX下有什么命令可以查看并修改这个路径?
f********h
发帖数: 149
2
if you use bash, export CLASSPATH=your_class_path_separated_by_colon
or csh, setenv CLASSPATH your_class_path_separated_by_colon

【在 g****o 的大作中提到】
: Thinking in Java的第5章讲了如何创建自己的package,里面提到了一个CLASSPATH环境
: 变量。书里给了一个例子:
: //:List.java
: // Creating a package
: package com.bruceekel.util;
: public class List {
: public List() {
: System.out.println("com.bruceeckel.util.List");
: }
: }

s*******s
发帖数: 3
3
better use java -classpath ...

【在 f********h 的大作中提到】
: if you use bash, export CLASSPATH=your_class_path_separated_by_colon
: or csh, setenv CLASSPATH your_class_path_separated_by_colon

s***m
发帖数: 28
4
Under Unix, you can check your classpath with this command,
echo $CLASSPATH
To add class path, insert new classpath mentioned by fryingfish in your
.bash_profile.
Then you have to reload profile by typing "source $HOME/.bash_profile"
If you have root access, you can add one file under /etc/profile.d/ directory.
This file will contain your export CLASSPATH command. To reload it, just type
. /etc/profile using root. Everything under /etc/profile.d/ will be loaded
everytime the system is started.


【在 s*******s 的大作中提到】
: better use java -classpath ...
1 (共1页)
进入Java版参与讨论
相关主题
.net vs. J2ee(zhuan)Unix: where to execute java program?
Jar question能这样编网站吗?
Re: Desperately need help on DB2 connection through jdbc in jsp pageRe: file permissions when using java creating files
菜鸟问题一问one way to show result windows while using VJ++
eclipse下生成的jar file不包含libraryRe: 奇怪?? import找不到package
[合集] How to remove absolute path in eclipse project fileRe: JDE1.2.2 Standard version下如何找classpath的?
Re: How to compile a Java program with import my own package in UNIXRe: java web server help!!!
jre classpathRe: 怎样递归操作目录,子目录以及他们下面的文件?
相关话题的讨论汇总
话题: classpath话题: java话题: javat话题: doc话题: list