• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

packages and folders

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! my apologies if this is not the correct subforum, the question is about beginning Eclipse

I've already compiled and run the "hello world" example but I need to run an already developed (not by me) software.

This software is in many folders, with the following structure:

D:\ folder1 \ folder2 \ folder3 \ folder4

folder4 contains 9 folders : A, B, C,....H, I.

In folder B there's a folder named "TESTS" where is the main that I need to run, in the first line of that class there's the
package folder1.folder2.folder3.TESTS;

I have all the .java classes but I need to compile all of them, I created a project but I don't know how to define the folder's structure in my project, I just copied the same structure in the Eclipse workspace but it did not work.

Sorry if the question is too naive.

Alexandra
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alexandra,
Welcome to JavaRanch! No need to apologize for asking a beginner question anywhere let alone the Beginning forum

In Eclipse, there is a "src" folder in a project when you first created it. This represents the "root." So if I have the package "com.javaranch.coding.MyClass", it goes in the directory. <my project's full path>/src/com/javaranch/coding.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going to move this to our IDEs forum since it is kind of about Eclipse.
 
alexandra kerr
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
I'm doing something wrong:
first I created a workspace for Eclipse D\alex
then I created a project MyProject there
As you said, when I created MyProject the D\alex\MyProject\src was created.
The class that I need to compile is in C\spv7.3\cb\pfv\spv\tests it is the package: package cb.pfv.spv.tests;

I copied the folders cb\pfv\spv\tests to D\alex\MyProject\src, so now I have
D\alex\MyProject\src\cb\pfv\spv\tests

Then I do File-Open File and open the file I need to compile from D\alex\MyProject\src\cb\pfv\spv\tests
then I try to compile it Project-Build Project but nothing happens.


 
alexandra kerr
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NOW IT WORKS!!!

Automatic compilation was turned on so i turned it off, then I refreshed the view and now could compile everything and there is a directory with the generated classes.

Now they are compiled with some warnings but no errors, thanks.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

alexandra kerr wrote:then I refreshed the view


This was the key step - Eclipse maintains its own "view" of the directories and files within a project. If you copy files, using OS tools, into or out of the project you must then refresh the project for Eclipse to use them.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alexandra,
Great! I'm glad to hear it is working now. And thanks for posting the solution for others who have the same problem.
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic