Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bobber205

macrumors 68020
Original poster
Nov 15, 2005
2,182
1
Oregon
This?

If I were to use that api in my java class, would user have to have that installed to use my class? Or does compiling take care of that?
 

mufflon

macrumors 6502
Sep 15, 2006
264
2
bobber205 said:
This?

If I were to use that api in my java class, would user have to have that installed to use my class? Or does compiling take care of that?


Nope, as long as you compiie it I see no problems at all - and this quesion isn't very awkward, all the .class needs should be included within itself.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Yes the user would have to have that class installed unless you bundle it up in your jar file yourself. When you compile on your system Java simply looks to see if the class is there. When you deploy your class on another machine you need to deploy this API as well. Java does not statically link the other classes in.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Either get the jar (like a zip) of the compiled jdom and unzip it or get the source and compile it. The compile your own code and bundle your code and the jdom stuff into one big jar. Job done.

You will need to check you are legally entitled to distribute jdom with your code and if there are any requirements in doing so (accreditation etc).
 

bobber205

macrumors 68020
Original poster
Nov 15, 2005
2,182
1
Oregon
I have the classes importing. One thing though. They came in a org.jdom hierarchy layout.
If I have to use more code to complete my project, and it starts with org, what do I do?

I tried to head off this problem by putting the org folder in a jdom folder, but the compilier doesn't like that. :D
 

weg

macrumors 6502a
Mar 29, 2004
888
0
nj
bobber205 said:
I have the classes importing.

Unlike include in C/C++, import does actually nothing. Well, at least not very much: It just provides information where to look for the class files (relative to the directory the application resides in or to the CLASSPATH.
If you want to package an application, you should put everything you need into a JAR, or provide information where the user can find the classes that you don't ship.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.