PERL INCLUDE PATH automatically from Java Code

Discussion in 'Perl Misc' started by eser@libero.it, Sep 7, 2007.

  1. Guest

    Hi all!
    I have a big problem..

    I developed an eclipse plugin who creates projects of "perl nature"
    with a particular path: I must modify the perl build path but I don't
    know what I have to do...In particular if I create the perl nature
    project now as now, it is created with the original perl build path
    and if I want to modify it I have to do right click on perl project
    that is create starting the plugin, then "Properties" and then "Perl
    Include Path", but I don't have to do this with my hands from the perl
    project view. The plugin must be done in a way that the perl project
    created must have the classpath already setted. If I don't modify this
    path from the java code, a module (file.pm, is a mine particular
    module who requires a particular path because call different USE in
    his package) that is loaded at the same time of the perl project
    returns errors because of some USE in file.pm .... who are not able to
    find the right path

    My java code now is:

    IWorkspace work=ResourcesPlugin.getWorkspace();

    IWorkspaceRoot workRoot=ResourcesPlugin.getWorkspace().getRoot();

    IProject newProject=workRoot.getProject(name);

    IProjectDescription
    newProjectDescription=work.newProjectDescription(name);

    String[] natureId=new String[1];

    natureId[0]="org.epic.perleditor.perlnature"; //PERL NATURE

    newProjectDescription.setNatureIds(natureId);

    ...............
    //Here I think is the place where I have to modify the perl path of
    the project the plugin is goig to create
    .........................
    newProject.create(newProjectDescription,null); //creazione progetto

    Can you give me an idea or a little piece of source code to resolve
    this problem?
    I browse a lot in the web but I didn't find any idea to continue...

    Is it possible to look throught perl path from java code?
    Thanks very much! I need some helps ..!


    Dani
    , Sep 7, 2007
    #1
    1. Advertising

  2. Klaus Guest

    Re: PERL INCLUDE PATH automatically from Java Code

    On Sep 7, 3:59 pm, wrote:

    [ snip ]

    > ...creates projects of "perl nature"
    > with a particular path: I must modify the perl build path but I don't
    > know what I have to do...


    [ snip ]

    > a module (file.pm, is a mine particular
    > module who requires a particular path because call different USE in
    > his package) that is loaded at the same time of the perl project
    > returns errors because of some USE in file.pm .... who are not able to
    > find the right path
    >
    > My java code now is:


    [ snip java ]

    I don't know anything about Eclipse or Java, but as far as Perl is
    concerned, you could read about "@INC" in "perldoc perlvar":

    =======================
    @INC
    The array @INC contains the list of places that the do EXPR, require,
    or use constructs look for their library files. It initially consists
    of the arguments to any -I command-line switches, followed by the
    default Perl library, probably /usr/local/lib/perl, followed by ``.'',
    to represent the current directory. (``.'' will not be appended if
    taint checks are enabled, either by -T or by -t.) If you need to
    modify this at runtime, you should use the use lib pragma to get the
    machine-dependent library properly loaded also:

    use lib '/mypath/libdir/';
    use SomeMod;

    You can also insert hooks into the file inclusion system by putting
    Perl code directly into @INC. Those hooks may be subroutine
    references, array references or blessed objects. See require in the
    perlfunc manpage for details.
    =======================

    --
    Klaus
    Klaus, Sep 7, 2007
    #2
    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. Andreas Bogenberger
    Replies:
    3
    Views:
    848
    Andreas Bogenberger
    Feb 22, 2008
  2. \A_Michigan_User\

    Various path/path/files.asp all #include this 1 file

    \A_Michigan_User\, Jul 10, 2005, in forum: ASP General
    Replies:
    1
    Views:
    221
    Jeff Cochran
    Jul 10, 2005
  3. Eric
    Replies:
    10
    Views:
    435
  4. Eric
    Replies:
    0
    Views:
    240
  5. me
    Replies:
    10
    Views:
    947
    ccc31807
    Mar 26, 2010
Loading...

Share This Page