Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Steve Jensen
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • 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

 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator


Do i do this in project properties?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!