Re: trivial third party jar dependancy
- From: thufir <hawat.thufir@xxxxxxxxx>
- Date: Fri, 28 Mar 2008 01:02:17 GMT
On Thu, 27 Mar 2008 18:07:55 +0000, Mark Space wrote:
Are you just asking how to use an external jar?
Yes.
I made a jar of just that Calculations class and now want this "Foo"
class (just HelloWorldApp with a different name in a different package)
to use Calculations as an external jar. (If I simply import
thufir.math.Calculations everything runs fine, the problem is with using
an external jar.)
thufir@arrakis:~/jrake$
thufir@arrakis:~/jrake$ pwd
/home/thufir/jrake
thufir@arrakis:~/jrake$
thufir@arrakis:~/jrake$ java -jar lib/thufir/math/Calculations.jar
Calculations.main
thufir@arrakis:~/jrake$
thufir@arrakis:~/jrake$ cd src/
thufir@arrakis:~/jrake/src$
thufir@arrakis:~/jrake/src$ javac -d /home/thufir/jrake/prod/ -cp "/home/
thufir/jrake/lib/thufir/math/Calculations.jar" thufir/foo/Foo.java
thufir@arrakis:~/jrake/src$ cd ..
thufir@arrakis:~/jrake$
thufir@arrakis:~/jrake$ ll src/thufir/foo/Foo.java
-rw-r--r-- 1 thufir thufir 205 2008-03-27 16:30 src/thufir/foo/Foo.java
thufir@arrakis:~/jrake$
thufir@arrakis:~/jrake$ ll prod/thufir/foo/Foo.class
-rw-r--r-- 1 thufir thufir 722 2008-03-27 17:41 prod/thufir/foo/Foo.class
thufir@arrakis:~/jrake$
thufir@arrakis:~/jrake$ cd prod/
thufir@arrakis:~/jrake/prod$
thufir@arrakis:~/jrake/prod$ java -cp . thufir.foo.Foo
the fibonacci of 9 is: Exception in thread "main"
java.lang.NoClassDefFoundError: thufir/math/Calculations
at thufir.foo.Foo.main(Foo.java:7)
thufir@arrakis:~/jrake/prod$
thanks,
Thufir
.
- References:
- trivial third party jar dependancy
- From: thufir
- Re: trivial third party jar dependancy
- From: Mark Space
- trivial third party jar dependancy
- Prev by Date: Using HEAD TRACE OPTIONS with http
- Next by Date: Re: trivial third party jar dependancy
- Previous by thread: Re: trivial third party jar dependancy
- Next by thread: Re: trivial third party jar dependancy
- Index(es):
Relevant Pages
|
|