Home arrow static arrow Java Programming [Archive] - package com.bruceeckel.simpletest does not exist.import com.bruceeckel.simp
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - package com.bruceeckel.simpletest does not exist.import com.bruceeckel.simp
This topic has 10 replies on 1 page.

Posts:17
Registered: 8/3/04
package com.bruceeckel.simpletest does not exist.import com.bruceeckel.simp  
Aug 4, 2004 12:28 PM



 
Sorry that I write again about this problem, but I can't manage with it.

When I'm trying to compile the program (Assigment.java) from book code appears an error:

D:\Java\Code\c03\Assignment.java:5: package com.bruceeckel.simpletest does not exist
import com.bruceeckel.simpletest.*;

It's not easy!! :(
I have SDk in c:\j2sdk1.4.2_05\
my projects are in d:\java
and the source code from the book: d:\java\code\
i copied the whole catalog com\bruceeckel\ into c:\j2sdk1.4.2_05\
I JCreator in options->JDK Profiles->j2sdk1.4.2_05(edit)->sources I added path c:\j2sdk1.4.2_05
And I don't know what else??

Please Help Me!!
 

Posts:2,206
Registered: 8/15/02
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 12:41 PM (reply 1 of 10)



 
Edna's #1 rule for Java Newbies... Never ever use an IDE

Now you have introduced a new variable to the problem. Assuming com.bruceeckel is in some jar file called bruce.jar (I like that), just add the the following to you class path
<path to bruce.jar>/bruce.jar
 

Posts:1,135
Registered: 1/16/04
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 1:27 PM (reply 2 of 10)



 
Edna's #1 rule for Java Newbies... Never
ever use an IDE


Now you have introduced a new variable to the problem.
Assuming com.bruceeckel is in some jar file called
bruce.jar (I like that), just add the the following
to you class path
<path to bruce.jar>/bruce.jar

I take it that you are working through Bruce Eckel's Thinking in Java book ( or online )... I checked it out myself not to long ago, and following the instructions, found that I had to do somethings prior to using his code samples and exercises...

One is to download his source code at http://mindview.net/Books/TIJ/#SourceCode

Two, when you read the page, it tell you that you need to compile the downloaded source code to run the examples in the book... follow the directions given in the above link...

Once its all compiled, then it will be ready for use, well after you set the classpath as per instructions...

and leave the IDE alone for now, once you get a better understanding of Java, then you can take the time to learn how to use the IDE, but for now, it will probable just confuse you more... But that only my opinion...

Any way, download, compile, set the classpath and your on your way...

- MaxxDmg...

- ' He who never sleeps... '
 

Posts:17
Registered: 8/3/04
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 2:24 PM (reply 3 of 10)



 
I don't know which classpath i have to set
 

Posts:17
Registered: 8/3/04
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 2:39 PM (reply 4 of 10)



 
It doesn't work
I compiled all source code with ANT and I set classpath and nothing.
I have JCreator and I can't compile almost any example. Assignment.java:

D:\Java\Code\c03\Assignment.java:5: package com.bruceeckel.simpletest does not exist
import com.bruceeckel.simpletest.*;
^
D:\Java\Code\c03\Assignment.java:12: cannot access Test
bad class file: D:\Java\Code\com\bruceeckel\simpletest\Test.class
class file contains wrong class: com.bruceeckel.simpletest.Test
Please remove or make sure it appears in the correct subdirectory of the classpath.
static Test monitor = new Test();
^
2 errors

Process completed.

What should I do
 

Posts:1,135
Registered: 1/16/04
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 2:45 PM (reply 5 of 10)



 
It depends...
Are you using the IDE, if so then check the "manual" ( or "Help" ) for how to set the classpath for the IDE...
From my understanding, most IDEs have a setting for the classpath which ignores the System's ClassPath variable ( i.e. WinXP, under System Properties, Advanced, Environment Variables ) which can be set under some menu in the IDE that you are using...

or if your not using an IDE then, check this link :
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html
which will give you some instruction on setting the ClassPath and using the -classpath switch...

One of the two will resolve the issue...

- MaxxDmg...

- ' He who never sleeps... '
 

Posts:17
Registered: 8/3/04
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 3:28 PM (reply 6 of 10)



 
this is horrilble, I'm trying to learn JAVA and I can't.

In JCreator -> options ->JDK profiles -> edit -> classes, I added a path d:\java\code\com\bruceeckel\simpletest and it does't work.

The classes in this path are compiled by ANT.

I don't know what is IDE??

BaxxterHP from Poland
 

Posts:2,206
Registered: 8/15/02
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 3:34 PM (reply 7 of 10)



 
I refer you to Edna's rule #1. JCreator is an IDE (Interactive Development Environment). IDE's can be used in 2 ways

1. By people who know the language to improve productivity
2. By people who don't know the language and think it is a shortcut to understanding.

It seems you fall into category 2

trash JCreator for now
 

Posts:10,967
Registered: 4/7/01
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 4, 2004 4:59 PM (reply 8 of 10)



 
trash JCreator for now

Edna's right, you know...

In fact, to relieve those feelings of inadequacy that you expressed above, I recommend that you do the introductory Sun Tutorial "Your First Cub of Java" here http://java.sun.com/docs/books/tutorial/ then return to Bruce's book.

This tutorial will restore your confidence - just follow it exactly, without the IDE.
 

Posts:17
Registered: 8/3/04
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 5, 2004 1:21 PM (reply 9 of 10)



 
Maybe you have right, but I know Java a little bit. I have only the problem with compiling this code. I tried it several times and I couldn't find the answer for my question.
 

Posts:2,206
Registered: 8/15/02
Re: package com.bruceeckel.simpletest does not exist.import com.bruceeckel.  
Aug 5, 2004 1:49 PM (reply 10 of 10)



 
OK, since i have never used JCreator, I can't help. I also know a little java, but still don't use an IDE (and probably never will).
 
This topic has 10 replies on 1 page.