由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 问个run java file 的问题
相关主题
Exception in thread "main" java.lang.NoClassDefFoundError[转载] Urgent Help needed about Java Servlet?
为何运行JAVA出现这个错误?系统class
Jar questionHelp!: tomcat classloading problem
question java command Re: Help!: tomcat classloading problem
Java funweird class definition
where to execute java program?java inner class - 初学者问
问个java on linux的奇怪问题使用JAVA的一则经验和教训
How to import a class?Dos and Don'ts about classpath
相关话题的讨论汇总
话题: java话题: classpath话题: file话题: jar话题: class
进入Java版参与讨论
1 (共1页)
c*******o
发帖数: 1722
1
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
2
java -classpath pax.jar;PDFBox.jar yourMainClass

【在 c*******o 的大作中提到】
: 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.

c*******o
发帖数: 1722
3
thx. but what is my main class?
i do not have my own class, just pax.jar and pdfbox.jar.
i will try.

【在 g*****g 的大作中提到】
: java -classpath pax.jar;PDFBox.jar yourMainClass
g*****g
发帖数: 34805
4
You probably can find a manifest.mf file in your pax.jar package.
It will specify main class inside.

【在 c*******o 的大作中提到】
: thx. but what is my main class?
: i do not have my own class, just pax.jar and pdfbox.jar.
: i will try.

c*******o
发帖数: 1722
5
okay, how do i run this java file from there? given i done
everything correctly as you adviced.
java -jar pax.jar?
thx

【在 g*****g 的大作中提到】
: You probably can find a manifest.mf file in your pax.jar package.
: It will specify main class inside.

c*******o
发帖数: 1722
6
这个东西好像没办法run,PDFBox.jar报错一堆,说某某class找不到,
可是我进去看了,明明是有。java 咋这难使呢?

【在 g*****g 的大作中提到】
: You probably can find a manifest.mf file in your pax.jar package.
: It will specify main class inside.

c*******o
发帖数: 1722
7
okay, it works in DOS now. but not linux.
linux says permission denied for pax.jar and pdfbox.jar.
but at least it works now.
thx

【在 g*****g 的大作中提到】
: You probably can find a manifest.mf file in your pax.jar package.
: It will specify main class inside.

g*****g
发帖数: 34805
8
use : as classpath separator on linux machine, and you may
need to make files excutable.

【在 c*******o 的大作中提到】
: okay, it works in DOS now. but not linux.
: linux says permission denied for pax.jar and pdfbox.jar.
: but at least it works now.
: thx

c*******o
发帖数: 1722
9
dude, i tried. after i make them x-able, it reports lots of errors.
but thx, at least it works now.

【在 g*****g 的大作中提到】
: use : as classpath separator on linux machine, and you may
: need to make files excutable.

Z****e
发帖数: 2999
10
when you use -jar option, the -classpath will be overriden by whatever is
set in pax.jar

【在 c*******o 的大作中提到】
: 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.

c*******o
发帖数: 1722
11
哇,厉害,好像还真是这么回事。

【在 Z****e 的大作中提到】
: when you use -jar option, the -classpath will be overriden by whatever is
: set in pax.jar

1 (共1页)
进入Java版参与讨论
相关主题
Dos and Don'ts about classpathJava fun
jre classpathwhere to execute java program?
请问在Java中有没有停止一切的命令问个java on linux的奇怪问题
入门Java CLASSPATH问题:How to import a class?
Exception in thread "main" java.lang.NoClassDefFoundError[转载] Urgent Help needed about Java Servlet?
为何运行JAVA出现这个错误?系统class
Jar questionHelp!: tomcat classloading problem
question java command Re: Help!: tomcat classloading problem
相关话题的讨论汇总
话题: java话题: classpath话题: file话题: jar话题: class