[program-l] Re: java:compilation and packaging

  • From: Andreas Stefik <stefika@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Sat, 20 Oct 2012 10:01:12 -0700

Tyler,

1. Yes, it does. javac automatically determines your dependencies and,
if it can find them, compiles them as well. There are some issues with
classpaths if it can't find what it needs, but that's a different
issue.

2. For Jar files, I personally use Sodbeans/NetBeans, as it does it
automatically when you use the build menu. You can do it on your own
using the jar utility from the command line. However, if you don't
plan on distributing your tool, it's really not necessary. A jar file
is just a zip file of your .class files with a special file called a
Manifest, which tracks what your main class/dependencies and other
stuff are. So, it makes the program clickable, but if you don't care
about that, then it isn't necessary.

Hope that helps,

Stefik

On Sat, Oct 20, 2012 at 8:02 AM, Littlefield, Tyler <tyler@xxxxxxxxxxxxx> wrote:
> Hello all:
> I read somewhere that using javac main.java or whatever would compile all
> other files that were in your package and used by main.java. Is this the
> case? also, how do people handli packaging of jar files? Do you need to do
> it for personal projects where you don't distribute?
>
> --
> Take care,
> Ty
> http://tds-solutions.net
> The aspen project: a barebones light-weight mud engine:
> http://code.google.com/p/aspenmud
> He that will not reason is a bigot; he that cannot reason is a fool; he that
> dares not reason is a slave.
>
> ** To leave the list, click on the immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
> ** If this link doesn't work then send a message to:
> ** program-l-request@xxxxxxxxxxxxx
> ** and in the Subject line type
> ** unsubscribe
> ** For other list commands such as vacation mode, click on the
> ** immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
> ** or send a message, to
> ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: