• 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

JBuilder 2005 - simple PACKAGE problem - please help me - anybody!!

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks, i've tried SEVERAL versions of JBuilder, and whatever one i've used, i've had the same problem. It's to do with Packages, ie, declaring and using them.

Ive posted some pictures below, of the folders i have created, what ive done in my JBuilder project setup, and the resuls of trying to compile the code.

Hope it's self-explanatory!

Below is the code for a 'simple' example on Packages, i've copied form a book.



Quite basically, ive created a folder called 'MyPack' on my c:, which has been placed inside a directory on my C: drive called 'Java'. ie. c:\Java\MyPack

Now, when i set up the program from the project properties in JBuilder (see screens (images 3-6), and try compile the program, i get the error stated in image 7.

PLEASE could somebody tell me what i am doing wrong

Cheers in advance!

Image 1



Image 2



Image 3



Image 4



Image 5



Image 6



Image 7

 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you're referencing c:\java as the root of your classpath for the compiler but using c:\java\MyPack as the root for storing the files of your project.

Remove that mismatch and it should compile.
 
Steve Jensen
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, i set the properties to the screenshot below (Image 8), and it seems to have solved that problem.

Image 8



But now, when i specify the main class, ie, the class containing the main method (Image 9), i get another error (Image 10) when i try & run it.

PLEASE, i've been struggling to with JBuilder all day, and if i could get this to work, i'd be ever go grateful.

Image 9




Image 10

 
Steve Jensen
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you have changed the root of your class tree. That means you have to change the location of your files as well, they're now one level too deep.
 
Steve Jensen
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Do i do this in project properties?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic