Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / October 2004

Tip: Looking for answers? Try searching our database.

beginners Question

Thread view: 
Bruno - 29 Oct 2004 17:43 GMT
Hello!

I have the following problem:
I get approx 200 errormessages when I try to compile the following
sourcecode with javac. Where is the problem?
Sourcecode:
---
import java.applet.*;
public class HelloInternet extends Applet {
}
---

Errormessages (cut):
---
C:\j2sdk1.4.2_06\src.zip(java/nio/charset/CharsetEncoder.java):561:
warning: asof release 1.4, assert is a keyword, and may not be used as an
identifier(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/nio/charset/CharsetEncoder.java):579:
warning: as
of release 1.4, assert is a keyword, and may not be used as an identifier
(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/net/URI.java):2572: warning: as of release
1.4, as
sert is a keyword, and may not be used as an identifier
(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/net/URI.java):2641: warning: as of release
1.4, as
sert is a keyword, and may not be used as an identifier
(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/net/URI.java):2662: warning: as of release
1.4, as
sert is a keyword, and may not be used as an identifier
(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/net/URI.java):2696: warning: as of release
1.4, as
sert is a keyword, and may not be used as an identifier
(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/net/URI.java):2707: warning: as of release
1.4, as
sert is a keyword, and may not be used as an identifier
(source unavailable)
C:\j2sdk1.4.2_06\src.zip(java/net/URI.java):2719: warning: as of release
1.4, as
sert is a keyword, and may not be used as an identifier
(source unavailable)
---

Please help, thx! :-(

Bruno
Alex Hunsley - 29 Oct 2004 18:00 GMT
> Hello!
>
[quoted text clipped - 6 lines]
> public class HelloInternet extends Applet {
> }

Thought of trying to google for an answer?
I tried it, and one of the first things was this:

http://www.javaranch.com/newsletter/Sept2002/asserttom.html

I think the advice about using -source might help. Have a look at the page.
J.F. Cornwall - 29 Oct 2004 18:24 GMT
>> Hello!
>>
[quoted text clipped - 13 lines]
>
> I think the advice about using -source might help. Have a look at the page.

As a reasonably experienced programmer who is new to Java, what search
terms would you use for finding out the problem?  I'm guessing at
"assert error Java", did you use those or something else?  And, being
pretty new to this dialect, I'd have picked "assert" only because it
appears in the error msg, not because of anything in the code.

Jim
Matt Humphrey - 29 Oct 2004 18:15 GMT
> Hello!
>
[quoted text clipped - 13 lines]
> warning: asof release 1.4, assert is a keyword, and may not be used as an
> identifier(source unavailable)

<Remaining messages snipped.>

Your code compiled fine for me under 1.4.2_03.  I would say the problem is
in how you enter the javac command.  It looks like you've put the src.zip
into the command line.  What did you type in?

Cheers,
Bruno - 29 Oct 2004 18:20 GMT
>> Hello!
>>
[quoted text clipped - 19 lines]
> in how you enter the javac command.  It looks like you've put the src.zip
> into the command line.  What did you type in?

I typed
javac HelloInternet.java

I work with 1.4.2_06

Thanks
Bruno

> Cheers,
Matt Humphrey - 29 Oct 2004 21:07 GMT
> >> Hello!
> >>
[quoted text clipped - 24 lines]
>
> I work with 1.4.2_06

I downloaded 1.4.2_06 and compiled your code with it.  It compiled without
any problem at all.  The command I used (in long form) verbatim on a W2K
machine

C:\j2sdk1.4.2_06\bin\javac HelloInternet.java

I retried the compiler by putting the src.zip into the classpath--which is a
mistake.  Using the command:

c:\j2sdk1.4.2_06\bin\javac -classpath c:\j2sdk1.4.2_06\src.zip
HelloInternet.java

I got about 100 errors, all looking something like

c:\j2sdk1.4.2_06\src.zip(java/nio/ByteBufferAsShortBufferB.java):34:
warning: as
of release 1.4, assert is a keyword, and may not be used as an identifier
(source unavailable)
c:\j2sdk1.4.2_06\src.zip(java/nio/ByteBufferAsShortBufferB.java):57:
warning: as
of release 1.4, assert is a keyword, and may not be used as an identifier
(source unavailable)

Your classpath incorrectly includes src.zip.  You probably don't need to
have anything in your classpath at all.

Cheers,
Matt Humphrey  matth@ivizNOSPAM.com  http://www.iviz.com/
Bruno - 30 Oct 2004 00:45 GMT
I really thank you all for your answers. I think Humhrey got it.

So long
Bruno

Am Fri, 29 Oct 2004 16:07:18 -0400 schrieb Matt Humphrey
<matth@ivizNOSPAM.com>:

>> >> Hello!
>> >>
[quoted text clipped - 62 lines]
> Cheers,
> Matt Humphrey  matth@ivizNOSPAM.com  http://www.iviz.com/

Signature

Erstellt mit M2, Operas revolutionärem E-Mail-Modul:
http://www.opera.com/m2/

hilz - 29 Oct 2004 23:38 GMT
> I typed
> javac HelloInternet.java
>
> I work with 1.4.2_06

maybe you have multiple versions of javac on your system, , and the one
being used is the wrong one.
try providing the complete path of the correct javac.exe file and see if
that solves the problem.

good luck

hilz
Frances Del Rio - 29 Oct 2004 18:58 GMT
> Hello!
>
[quoted text clipped - 6 lines]
> public class HelloInternet extends Applet {
> }

I'm also kind of a beginner, but even I can answer this one..  complete
code for this applet should be:

import java.applet.*;
import java.awt.*;
public class HelloInternet extends Applet {
    public void paint(Graphics g) {
        g.drawString("Hello world!", 50, 25);
    }
}

(code is from here...
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
(and tested in my own environment..)

took out comments, and changed class name to what you
have(HelloInternet); otherwise code is identical..)

good luck, hope this helps...  Frances


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.