aspose file tools*
The moose likes Beginning Java and the fly likes DotComBust - The Game,  Page 148 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "DotComBust - The Game,  Page 148" Watch "DotComBust - The Game,  Page 148" New topic
Author

DotComBust - The Game, Page 148

Babi Szolosi
Greenhorn

Joined: Jun 03, 2005
Posts: 2
Hi All,
This is my very first post on this site - I am still getting used to the language and the different design concept, but I like it.

I am using JDK1.5.0_03, installed especially for this exercise, but I also have the previous version, j2sdk1.4.2_07.
I have typed in the whole source code, all the classes, etc, but when I tried to compile it, the compiler didn't like the ArrayList<> declaration.
I started looking into the API and found that the problem should be somewhere in the Generics area (this was proved when I opened the source in JBuilder).
Looked at some tutorials on java.sun and found that all the declarations are correct; then checked out the readme file and found that this is a known problem and the workaround is using -source 1.4 on the javac command line.
OK, did that too, same error; deleted both class and path variables related to the 1.4 version, but still didn't work.
What am I doing wrong?
Thanks in advance.
Babi
Update: I have used the -source 1.5 switch, that solved that problem now I get 13 errors, all saying "cannot find symbol". All the files are in the same directory and when at command line I am in that directory.
Forgot to tell you: I am using XP.

BTW, by browsing previous posts, I've already learned many things. Thanks.
[ June 04, 2005: Message edited by: Babi Szolosi ]
Alan Jump
Greenhorn

Joined: May 25, 2005
Posts: 26
Adding generics to ArrayList() is a new feature in the 1.5 SDK; the 1.4 compiler will reject it.

I'd suggest looking at your PATH environment variable and seeing if the 1.4 compiler is being called when you enter 'javac'. If you rearrange your PATH so the 1.5 SDK appears first, the 1.5 compiler will be called first. The alternative is entering the full pathname to the 1.5 compiler (which is more typing than I like, since I'm fairly lazy).

Hope this helps...
Jeremy Clark
Greenhorn

Joined: May 03, 2005
Posts: 3
IIRC, Borland's JBuilder still installs a version of the 1.4 SDK and uses that. This is why the book recommends using a text editor over an IDE for learning Java to start with and compiling from the command line, as configuring an IDE can be a little confusing at first. I've been pretty happy with jEdit so far.

If you absolutely have to have an IDE, you may want to look at NetBeans, which plays nice with Java 1.5 and is sponsored by Sun.

-J
Alan Jump
Greenhorn

Joined: May 25, 2005
Posts: 26
Originally posted by Jeremy Clark:
IIRC, Borland's JBuilder still installs a version of the 1.4 SDK and uses that.


You are correct, it does. But that can be overridden fairly easily. Install the 1.5 SDK as usual, then go to Tools -> Configure -> JDKs, select Add, then point to the directory the new SDK is installed in. Then go to Project -> Default Project Properties and select the new SDK as the JDK to build with.

(Hrm...maybe this thread should be moved?)
Babi Szolosi
Greenhorn

Joined: Jun 03, 2005
Posts: 2
Hi All,

Thanks a lot for the advice. Last night I was desperate and did all the things you have suggested (before reading your posts, I am in Melbourne Australia...time difference) and at the end JGrasp helped me out: pointed out the places where I made TYPOS .
The best bit is that you proved that I did the right thing and while trying to figure it all out, I've learnt heaps of stuff.

Thanks again, much appreciated.
Babi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DotComBust - The Game, Page 148
 
Similar Threads
Unwanted StringBuilder reference at runtime
Java1.4 on Solaris 2.6
Something is wrong with my Java on LInux...
Am i missing something here?
B&S Passed 367/400