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
|