Hello World problem

Discussion in 'Java' started by John Dildy, Nov 30, 2012.

  1. John Dildy

    John Dildy Guest

    John Dildy, Nov 30, 2012
    #1
    1. Advertising

  2. John Dildy

    FredK Guest

    FredK, Nov 30, 2012
    #2
    1. Advertising

  3. John Dildy

    Tim Slattery Guest

    John Dildy <> wrote:

    >I have entered the Hello World file correctly but I am told I am missing a semicolon in line 1 when I attempt to run the file.
    >
    >Here is my script:
    >
    >https://script.google.com/d/1Agf_C5ERSvWtsMt4LigAxCDTpj598IkMSd4reLRpefMf83xbcyuMo9iI/edit
    >
    >Anyone able to help me understand where exactly I have to put the semi colon at?


    Here's what I see there:

    function myFunction() {

    }

    That looks like JavaScript, not Java. They are very different things.
    Which are you actually trying to use?

    Assuming it's JavaScript, you have an empty function. It looks to me
    like it should run, but it wouldn't do anything. How did you try to
    run it?

    If you are trying to use JavaScript, this conversation should move to
    comp.lang.javascript

    --
    Tim Slattery
    Tim Slattery, Nov 30, 2012
    #3
  4. John Dildy

    Roedy Green Guest

    On Fri, 30 Nov 2012 07:19:44 -0800 (PST), John Dildy
    <> wrote, quoted or indirectly quoted someone who
    said :

    >
    >https://script.google.com/d/1Agf_C5ERSvWtsMt4LigAxCDTpj598IkMSd4reLRpefMf83xbcyuMo9iI/edit
    >
    >Anyone able to help me understand where exactly I have to put the semi colon at?


    see http://mindprod.com/jgloss/helloworld.html if you want to write a
    HelloWorld in Java.

    I don't think that is what you want to do, however. You have Java
    confused with some other language.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    Students who hire or con others to do their homework are as foolish
    as couch potatoes who hire others to go to the gym for them.
    Roedy Green, Nov 30, 2012
    #4
  5. John Dildy

    John Dildy Guest

    I have made changes to the project and I don't see the empty Javascript function. However, I am trying to use Java.

    Does anyone know if there is a beginner's group on google about Java and/or Javascript. I see to be contacting people that are way a way's from the HelloWorld.java
    John Dildy, Dec 2, 2012
    #5
  6. John Dildy

    Arne Vajhøj Guest

    On 12/1/2012 9:45 PM, John Dildy wrote:
    > I have made changes to the project and I don't see the empty Javascript function. However, I am trying to use Java.
    >
    > Does anyone know if there is a beginner's group on google about Java and/or Javascript. I see to be contacting people that are way a way's from the HelloWorld.java


    comp.lang.java.help may be a bit more beginner friendly than
    comp.lang.java.programmer!

    comp.lang.javascript sounds as if it is a good place for
    JavaScript, but I have never read it.

    Arne
    Arne Vajhøj, Dec 2, 2012
    #6
  7. John Dildy

    Joerg Meier Guest

    On Sat, 1 Dec 2012 18:45:06 -0800 (PST), John Dildy wrote:

    > I have made changes to the project and I don't see the empty Javascript function. However, I am trying to use Java.


    > Does anyone know if there is a beginner's group on google about Java and/or Javascript. I see to be contacting people that are way a way's from the HelloWorld.java


    Java is not related to Javascript. As you have posted on

    https://script.google.com/d/1Agf_C5ERSvWtsMt4LigAxCDTpj598IkMSd4reLRpefMf83xbcyuMo9iI/edit

    your project files end with .js, which is Javascript, and not .java, which
    is Java. Your code also contains "function myFunction()", which is a
    Javascript function, and not a Java method.

    I'm afraid you really are completely in the wrong place here. Despite the
    strange similarity in name, Java and Javascript really are not related AT
    ALL. This isn't like Basic and Visual Basic, two versions of the same
    language, Java and Javascript are as unrelated as Georgia, USA and Georgia,
    the country next to Russia.

    People here are of course perfectly capable of "Hello World" examples, but
    only in the language of this newsgroup - which is Java. We don't know
    anything at all about Javascript (other than by random chance).

    That being said, even people in a Javascript help group won't be able to
    help you if you ignore peoples replies. Multiple people have asked you
    questions about your attempted "Hello World" example, yet you have answered
    none. If you are looking for mind readers, you might have to go look for a
    different newsgroup alltogether.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
    Joerg Meier, Dec 2, 2012
    #7
  8. John Dildy

    John Dildy Guest

    For some reason the Google Script is messing with my file which I clearly classified it as .java instead of .js (javascript)

    I have done the same with eclipse and I have gotten the right output in the HelloWorld.java file.

    Thank you for giving some information out.
    John Dildy, Dec 3, 2012
    #8
  9. John Dildy

    Joerg Meier Guest

    On Sun, 2 Dec 2012 17:51:39 -0800 (PST), John Dildy wrote:

    > For some reason the Google Script is messing with my file which I clearly classified it as .java instead of .js (javascript)


    That's because Google Script is a Javascript scripting language.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
    Joerg Meier, Dec 3, 2012
    #9
  10. On 12/2/2012 6:05 AM, Martin Gregorie wrote:
    > On Sat, 01 Dec 2012 22:39:38 -0500, Arne Vajhøj wrote:
    >
    >> On 12/1/2012 9:45 PM, John Dildy wrote:
    >>> I have made changes to the project and I don't see the empty Javascript
    >>> function. However, I am trying to use Java.
    >>>
    >>> Does anyone know if there is a beginner's group on google about Java
    >>> and/or Javascript. I see to be contacting people that are way a way's
    >>> from the HelloWorld.java

    >>
    >> comp.lang.java.help may be a bit more beginner friendly than
    >> comp.lang.java.programmer!
    >>
    >> comp.lang.javascript sounds as if it is a good place for JavaScript, but
    >> I have never read it.
    >>

    > I visited some years ago. Not a friendly place.


    Hm.

    Dislike of beginners or narrow definition of on topic?

    > In any case, I don't think its a suitable language for a programming
    > newbie: maybe things have changed, but I wasn't able to find a good book
    > to learn it up from. I was looking for something like the O'Reilly
    > Python, PHP or awk&sed books, but could find nothing apart from
    > collections of code snippets and definitely nothing with a coherent
    > description of its syntax and run-time environment.


    I have not read it myself but Professional JavaScript for Web Developers
    from Wrox get good reviews and I have good experience with their
    Professional Xxxxxxx books.

    And ECMA-262 is not hard to read. It is a lot easier than JLS.

    Runtime environment is a bit more tricky, because it somewhat
    depends on the runtime.

    :)

    Old IE, new IE, FF, Chrome, node.js etc. are not identical.

    Arne
    Arne Vajhøj, Dec 4, 2012
    #10
  11. On 12/4/2012 5:43 PM, Martin Gregorie wrote:
    > On Mon, 03 Dec 2012 22:43:52 -0500, Arne Vajhøj wrote:
    >> And ECMA-262 is not hard to read. It is a lot easier than JLS.
    >>

    > I asked about language manuals, got pointed at "Javascript for the World
    > Wide Web", which I thought should be good because I like Elizabeth
    > Castro's "HTML for the World Wide Web" a lot. However the Js book isn't
    > nearly as good: instead its much as I described with the language
    > elements being buried under a heap of examples and details of browser
    > specifics. There are some pretty good books where I worked at the time,
    > but none seemed any better: most seemed to be aimed at people who can't
    > program but who can paste half-understood bits of code into their web
    > pages and hack at them until they do something useful.
    >
    > The ECMA-262 specification was never mentioned on that newsgroup or I'd
    > have grabbed and used it.


    It is pretty compact.

    188 pages to cover both language and some core classes (a la
    java.lang package in Java),

    >> Runtime environment is a bit more tricky, because it somewhat depends on
    >> the runtime.
    >>

    > Yes, sure. But, is that poor language design and specification or merely
    > a lack of rigour on the part of the interpreter writers?


    Well - I am not a JavaScript expert, but based on my very limited
    knowledge about this then the main problem is that use of JavaScript
    in browsers are highly dependent on the HTML DOM model and CSS support
    used in the browser. So JavaScript is really suffering from the chaos
    in the HTML world and not so much due to its own problems.

    Obviously browser JavaScript and node.js usage varies a lot - applets
    and Java EE are also quite different.

    Arne
    Arne Vajhøj, Dec 5, 2012
    #11
  12. John Dildy

    Roedy Green Guest

    On Sun, 2 Dec 2012 17:51:39 -0800 (PST), John Dildy
    <> wrote, quoted or indirectly quoted someone who
    said :

    >For some reason the Google Script is messing with my file which I clearly classified it as .java instead of .js (javascript)


    How would it even know your file existed? You must have told it. Give
    it instead to the proper tool, Javac.exe.

    See http://mindprod.com/jgloss/helloworld.html
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    Students who hire or con others to do their homework are as foolish
    as couch potatoes who hire others to go to the gym for them.
    Roedy Green, Dec 5, 2012
    #12
  13. John Dildy

    John Dildy Guest

    Could someone just delete or either stop replying, I have it fixed, just that I shouldn't be putting the .java codes into a .js scripture tool.
    John Dildy, Dec 5, 2012
    #13
  14. On 12/4/2012 6:09 PM, Arne Vajhøj wrote:
    > On 12/4/2012 5:43 PM, Martin Gregorie wrote:
    >> The ECMA-262 specification was never mentioned on that newsgroup or I'd
    >> have grabbed and used it.

    >
    > It is pretty compact.
    >
    > 188 pages to cover both language and some core classes (a la
    > java.lang package in Java),


    That's a pretty unfair comparison. JavaScript is dynamically-typed,
    which means it just has to cover runtime semantics and can ignore a lot
    of the complexity that statically-typed object-oriented systems bring.
    Effectively, JS only needs to specify equivalents to sections 1-3, 14,
    and 15 of the JLS (with small portions of other sections), which comes
    out 215 pages by my count. Even then, the JLS also includes bulky parts
    in these sections that JS can happily ignore a lot of, including how to
    find candidate method overloads (a thick 30 pages unneeded in dynamic
    languages).

    The core JS library is also pitiful by Java's standards, being far
    smaller than even just java.lang: Array corresponds vaguely to
    java.lang.ArrayList, String to java.lang.String, Math to java.lang.Math,
    Number to java.lang.Double, Date to java.util.Date (minus almost all
    locale concerns), RegExp to java.text.regex.Pattern, and Object and
    Function both covering features which don't really exist in Java but
    could be considered roughly equivalent to java.lang.Class.

    >>> Runtime environment is a bit more tricky, because it somewhat depends on
    >>> the runtime.
    >>>

    >> Yes, sure. But, is that poor language design and specification or merely
    >> a lack of rigour on the part of the interpreter writers?

    >
    > Well - I am not a JavaScript expert, but based on my very limited
    > knowledge about this then the main problem is that use of JavaScript
    > in browsers are highly dependent on the HTML DOM model and CSS support
    > used in the browser. So JavaScript is really suffering from the chaos
    > in the HTML world and not so much due to its own problems.


    When most people talk about JS, they're really talking about JS +
    "HTML5", which I'm using here to refer to both the DOM APIs presented by
    the HTML specification itself and the large collection of auxiliary APIs
    that are assumed to be implemented by web browsers. Most variance in
    practice tends to be associated with the DOM.

    That said, there are some places where I've heard that increasing
    compatibility is contentious by various engine writers; the biggest one
    I know of is the iteration order of object properties (particularly if
    you have both "foo" and 0 as properties...).

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
    Joshua Cranmer, Dec 6, 2012
    #14
  15. John Dildy

    John Dildy Guest

    Like I have had my problem realized that it was Javascript. However, I thank all of you giving information about JavaScript. I really do, it is just there are some repeats which is making this discussion pretty much repeated constant.

    I have understand that I am having to use an IDE like Eclipse.
    John Dildy, Dec 6, 2012
    #15
  16. John Dildy

    Lew Guest

    John Dildy wrote:
    > Like I have had my problem realized that it was Javascript. However, I thank all of you giving information about JavaScript. I really do, it is just there are some repeats which is making this discussion pretty much repeated constant.
    >
    > I have understand that I am having to use an IDE like Eclipse.


    It's not a requirement, it's a convenience.

    If you do Javascript work, the Aptana plugin (or standalone studio version) for
    Eclipse is pretty good. I do mixed-language work (JS, Java, Python, Ruby, ...) and I
    love this plugin.
    http://www.aptana.com/

    Alas, I don't know of any way to make Eclipse friendly for editing bash/zsh scripts.

    --
    Lew
    Lew, Dec 6, 2012
    #16
  17. John Dildy

    John Dildy Guest

    On Thursday, December 6, 2012 6:29:27 PM UTC-5, Lew wrote:
    > John Dildy wrote:
    >
    > > Like I have had my problem realized that it was Javascript. However, I thank all of you giving information about JavaScript. I really do, it is just there are some repeats which is making this discussion pretty much repeated constant.

    >
    > >

    >
    > > I have understand that I am having to use an IDE like Eclipse.

    >
    >
    >
    > It's not a requirement, it's a convenience.
    >
    >
    >
    > If you do Javascript work, the Aptana plugin (or standalone studio version) for
    >
    > Eclipse is pretty good. I do mixed-language work (JS, Java, Python, Ruby, ...) and I
    >
    > love this plugin.
    >
    > http://www.aptana.com/
    >
    >
    >
    > Alas, I don't know of any way to make Eclipse friendly for editing bash/zsh scripts.
    >
    >
    >
    > --
    >
    > Lew


    I didn't really mean to say it was a requirement
    John Dildy, Dec 7, 2012
    #17
  18. On 12/6/2012 4:52 PM, Joshua Cranmer wrote:
    > On 12/4/2012 6:09 PM, Arne Vajhøj wrote:
    >> On 12/4/2012 5:43 PM, Martin Gregorie wrote:
    >>> The ECMA-262 specification was never mentioned on that newsgroup or I'd
    >>> have grabbed and used it.

    >>
    >> It is pretty compact.
    >>
    >> 188 pages to cover both language and some core classes (a la
    >> java.lang package in Java),

    >
    > That's a pretty unfair comparison. JavaScript is dynamically-typed,
    > which means it just has to cover runtime semantics and can ignore a lot
    > of the complexity that statically-typed object-oriented systems bring.
    > Effectively, JS only needs to specify equivalents to sections 1-3, 14,
    > and 15 of the JLS (with small portions of other sections), which comes
    > out 215 pages by my count. Even then, the JLS also includes bulky parts
    > in these sections that JS can happily ignore a lot of, including how to
    > find candidate method overloads (a thick 30 pages unneeded in dynamic
    > languages).
    >
    > The core JS library is also pitiful by Java's standards, being far
    > smaller than even just java.lang: Array corresponds vaguely to
    > java.lang.ArrayList, String to java.lang.String, Math to java.lang.Math,
    > Number to java.lang.Double, Date to java.util.Date (minus almost all
    > locale concerns), RegExp to java.text.regex.Pattern, and Object and
    > Function both covering features which don't really exist in Java but
    > could be considered roughly equivalent to java.lang.Class.


    It may be unfair but what so?

    It is still only 188 pages.

    It does not get easier to read more pages by the fact that more
    pages is necessary due to the nature of the language.

    >>>> Runtime environment is a bit more tricky, because it somewhat
    >>>> depends on
    >>>> the runtime.
    >>>>
    >>> Yes, sure. But, is that poor language design and specification or merely
    >>> a lack of rigour on the part of the interpreter writers?

    >>
    >> Well - I am not a JavaScript expert, but based on my very limited
    >> knowledge about this then the main problem is that use of JavaScript
    >> in browsers are highly dependent on the HTML DOM model and CSS support
    >> used in the browser. So JavaScript is really suffering from the chaos
    >> in the HTML world and not so much due to its own problems.

    >
    > When most people talk about JS, they're really talking about JS +
    > "HTML5", which I'm using here to refer to both the DOM APIs presented by
    > the HTML specification itself and the large collection of auxiliary APIs
    > that are assumed to be implemented by web browsers. Most variance in
    > practice tends to be associated with the DOM.
    >
    > That said, there are some places where I've heard that increasing
    > compatibility is contentious by various engine writers; the biggest one
    > I know of is the iteration order of object properties (particularly if
    > you have both "foo" and 0 as properties...).


    It is my understanding that the problem of different DOM's will
    mostly go away with HTML 5 as that standard actually specify the DOM.

    Arne
    Arne Vajhøj, Dec 8, 2012
    #18
  19. On Tue, 4 Dec 2012 22:43:59 +0000 (UTC), Martin Gregorie
    <> wrote:

    >On Mon, 03 Dec 2012 22:43:52 -0500, Arne Vajhøj wrote:
    >
    >> On 12/2/2012 6:05 AM, Martin Gregorie wrote:
    >>> On Sat, 01 Dec 2012 22:39:38 -0500, Arne Vajhøj wrote:


    [snip]

    >>>> comp.lang.javascript sounds as if it is a good place for JavaScript,
    >>>> but I have never read it.
    >>>>
    >>> I visited some years ago. Not a friendly place.

    >>
    >> Hm.
    >>
    >> Dislike of beginners or narrow definition of on topic?
    >>

    >Difficult to know. Seemed most like a bunch of acolytes fawning on every
    >word of a self-appointed newsgroup leader who knew almost nothing except
    >Javascript but didn't let that stop him handing down tablets about other
    >languages.


    I do follow it. There are a few people like that, but most are
    not. It is friendly to beginners actually trying to learn.

    [snip]

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Dec 13, 2012
    #19
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vijay
    Replies:
    8
    Views:
    705
  2. Roy
    Replies:
    6
    Views:
    610
    Roedy Green
    Jan 7, 2008
  3. Hongyu
    Replies:
    16
    Views:
    672
    mail oo
    Aug 6, 2008
  4. thanat0s
    Replies:
    21
    Views:
    1,048
    Arne Vajhøj
    Jun 9, 2010
  5. Larry
    Replies:
    27
    Views:
    424
    Michele Dondi
    Jan 25, 2005
Loading...

Share This Page