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

Eclipse: Can't add new package

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello and thank you in advance.

I am having a problem adding a new class and package (not default) to a dynamic web project in Eclipse. When I add the package, it is displayed under Java Resources: src as an expanded folder (not a package) in the package explorer window and the .java file is not compiled to a .class file when saved. I have "Build Automatically" checked in the project settings and the java build path settings for the source output folder look OK.

By comparison, using another test project (dynamic web) that I created, the new package is added to the project under Java Resources: src as a package (not a folder) and works just fine. The .java file is compiled to the build\classes directory and I am able to use the class in a JSP.

I am not able to determine what the difference is between the two projects that might be causing this issue.

Any suggestions are greatly appreciated.

Thanks,
Carl


 
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
Carl, welcome to Java Ranch!

It looks like the src folder is not defined as a source folder. Right click on src and select Build Path | Use as Source Folder.
 
Carl Zeigler
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, thank you, thank you! I had to first remove src from the build path then I was able to select -> build path | use as source folder. Worked like a charm.

Carl
 
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic