redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Friday 03 September 2010 04:51

Ask your IT question here

the compiler can't find a jar package


Goto page 1, 2  Next
 
Post new topic   Reply to topic    Programming Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
PMandy
New Programmer


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
Reply with quote
 
AmeliaR
Enthusiastic Coder


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
Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
PMandy, classpath is an environment variable, or command line option for Java that tells the Java compiler and runtime where certain libraries are. For more information, see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html
Reply with quote
 
PMandy
New Programmer


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
Reply with quote
 
Ikopar
Enthusiastic Coder


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.
Reply with quote
 
PMandy
New Programmer


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

Reply with quote
 
Ikopar
Enthusiastic Coder


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.

Reply with quote
 
AmeliaR
Enthusiastic Coder


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 :)

Reply with quote
 
PMandy
New Programmer


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

Reply with quote
 
Ikopar
Enthusiastic Coder


Joined: 26 May 2006
Posts: 168
PMandy, wrong approach.
Reply with quote
 
Page 1 of 2 Goto page 1, 2  Next
Post new topic   Reply to topic    Programming Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Based on phpBB © 2001-2010 RedHo