facebook

compiling 5 java files [Closed]

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #232326 Reply

    prakashm
    Member

    I have 5 java files that I would like to compile using eclispe/myeclipse. These files are kept together with other java files in same folder.

    For example, my directory structure looks like

    dir/dir2/dir3/myclass1.java
    dir/dir2/dir3/myclass2.java
    ..and so on.

    Also there are other files that I don’t care about

    dir/dir2/dir3/otherclass1.java
    dir/dir2/dir3/otherclass2.java
    dir/dir2/dir3/otherclass3.java

    and so on.

    I want to compile my classes without adding any extra folder and files(except .class) to dir. In-order to do that I create a java project in /my/workspace. I see a project created with default JRE jars included. So far so good.

    The next step is to add
    dir/dir2/dir3/otherclass1.java
    dir/dir2/dir3/otherclass2.java
    dir/dir2/dir3/otherclass3.java
    to project.

    I tried doing so by right clicking on project in package explorer and selecting build path->link additional sources to project -> browse and selecting dir. Doing so eclipse selects all files under dir which is ok.

    I then define a working set and select only those files that i want to compile. I then compile my newly created working set. But eclipse tries to compile all files and I don’t need that. I want eclipse to compile only these files.

    dir/dir2/dir3/otherclass1.java
    dir/dir2/dir3/otherclass2.java
    dir/dir2/dir3/otherclass3.java

    Is it possible?

    Thanks

    #232340

    Scott Anderson
    Participant

    In short, no. Eclipse will always compile all the java files it finds in a source folder. You can’t pick and choose which ones get built or when.

    #232358

    prakashm
    Member

    Thanks for a quick response.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: compiling 5 java files [Closed]

You must be logged in to post in the forum log in