| View previous topic :: View next topic |
| Author |
Message |
PMandy
Joined: 05 Jun 2006 Posts: 11
|
| Hello, i have compiled a jar package, and now i wanna use it in another program.. the problem is, the compiler can't find it, even if i put the jar file in the same folder as the .java file of the program i'm trying to use it with |
| |
|
|
|
|
AmeliaR
Joined: 31 May 2006 Posts: 142
|
| PMandy, you need to include it into your classpath, there are resources online you can use to learn how |
| |
|
|
BigDaddy
Joined: 26 May 2006 Posts: 147
| |
PMandy
Joined: 05 Jun 2006 Posts: 11
|
| Alright... i'm using Xcode on a mac, so the descriptions i've found so far doesn't make sense |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| PMandy, use the commandline/shell to compile and run your application until you figure out your dev tools. most dev tools seem to have something like project settings where the class path is to be configured on a per project basis. |
| |
|
|
PMandy
Joined: 05 Jun 2006 Posts: 11
|
But in the Thinking in Java book, it says i dont need to do this if the jar is in the same path as the program itself
Or maybe i just misunderstood |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
PMandy, where exactly does it say that? i am pretty sure you misread that.
Because the class path mechanism does not work that way, obvious exceptions aside.
The standard cp mechanism provided by sun, one could say. |
| |
|
|
AmeliaR
Joined: 31 May 2006 Posts: 142
|
PMandy, the IDE you're using probably has settings somewhere you need to change to make this work... see if you have "Project Properties" or something similar
do note, however, that at some point you'll have to figure out how to make this stuff work in a terminal as well -- since your users won't have all have Xcode :) |
| |
|
|
PMandy
Joined: 05 Jun 2006 Posts: 11
|
AmeliaR, the user will probably be on a windows machine
So i suppose that's just a question of writing a simple BAT-file
Ikopar, thanks, ill check that out
Why can't you just launch the .class file in windows?
Works fine in macos |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| PMandy, wrong approach. |
| |
|
|
|