Include File

Discussion in 'Java' started by Sun, Jun 21, 2004.

  1. Sun

    Sun Guest

    Have anyone an idea for including a file in a Java source code (not JSP)?

    Thanks to all in advance!
    Riccardo
    Sun, Jun 21, 2004
    #1
    1. Advertising

  2. Sun

    DigiAl Guest

    "Sun" <> wrote in message
    news:p...
    > Have anyone an idea for including a file in a Java source code (not JSP)?
    >
    > Thanks to all in advance!
    > Riccardo
    >



    Why would you want to do that? For server side / messy programming it is
    needed but for Java (and anyother similar languages) its not really needed.

    alan.
    DigiAl, Jun 21, 2004
    #2
    1. Advertising

  3. "Sun" <> wrote:
    > Have anyone an idea for including a file in a Java source code (not JSP)?



    If you insist in making your life really miserable,
    then there is nothing
    to prevent you from either using cpp or m4, like
    in a C program. Except you have to call cpp
    yourself, because javac will not do this for you.-)

    Harald.
    Harald Kirsch, Jun 21, 2004
    #3
  4. Sun

    Roedy Green Guest

    On Mon, 21 Jun 2004 08:44:01 GMT, "Sun" <> wrote or
    quoted :

    >Have anyone an idea for including a file in a Java source code (not JSP)?


    Write a little macro preprocessor that handles your include. Use the
    C preprocessor.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 21, 2004
    #4
  5. Sun

    Roedy Green Guest

    On 21 Jun 2004 08:13:36 -0700, (Harald Kirsch) wrote
    or quoted :

    >
    >If you insist in making your life really miserable,
    >then there is nothing
    >to prevent you from either using cpp or m4, like
    >in a C program. Except you have to call cpp
    >yourself, because javac will not do this for you.-)


    I do some simple things like embed the name of the compiler used by
    simply copying one of two variants to the official java file just
    prior to compilation. You can do slightly more elaborate things with
    simple file concatenation.

    As a simple antipiracy measure, and as a very flexible configuration
    tool, I sometimes copy a configuration file written in Java for a
    customer to the official configuration then compile, to hard code in
    all the constants.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 21, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    533
    Exits Funnel
    Mar 6, 2005
  2. PTM
    Replies:
    1
    Views:
    326
    Andy Dingley
    Nov 12, 2007
  3. naveeddil
    Replies:
    0
    Views:
    560
    naveeddil
    Jan 4, 2008
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    899
    Andreas Bogenberger
    Feb 22, 2008
  5. Eric
    Replies:
    10
    Views:
    460
Loading...

Share This Page