• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Compiling a package

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

anyone know of any ways to compile recursively for a package of .javas?
i.e. My .java files are located at C:/src/*.../*.java

Thanks.


Regards,
Zylias
 
Marshal
Posts: 76845
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a package name in your .java files?
 
Zylias Kestravale
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Do you have a package name in your .java files?



yes.

csci.search.*.*

asterisks for all the subpackages that I have. Any idea how to compile the package without having to know/indicate all the package paths? Thanks.
 
Campbell Ritchie
Marshal
Posts: 76845
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you really want to compile the whole lot at once, navigate to a directory, and copy all the .java files into that same directory.

Then try

javac -d . *.java

You will find questions about compiling with package names quite frequently. Here is an old thread where I link to an older thread. Doing a search or following those links will (I hope) give you lots more information. If you have lots of files, using an IDE or "ant" may make life easier for you.

 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're using a real OS, something like

javac `find . -name '*.java'`

works great, of course. But really, learn to use Ant. If your project is complicated enough for you to ask this question, you need to be using a build tool of some kind to make sure the build is done correctly each time.
 
Did you just should on me? You should read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic