Page 1 of 2 12 LastLast
Results 1 to 20 of 22
Like Tree1Likes

Thread: Can't launch jdk after installation arrrrrrrrgghhhhh!!!!!!!!

  1. #1
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default Can't launch jdk after installation arrrrrrrrgghhhhh!!!!!!!!

    Hi guys,

    I am having a simple problem in running jdk, which I have just downloaded from the oracle site. I have selected the correct download (Java SE Development Kit 6u26) with windows-64 bit. The installation and registration was ok, but I can't seem to find an executable file that will allow me to launch the compiler which is extremely irritating. Does anyone have any suggestions?

    thanks for reading my message.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,939
    Rep Power
    8

    Default

    I'm not sure what you really mean- that's not really how the compiler works. Are you expecting a GUI of some kind?

    Recommended reading: "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    no I meant compiler so that I can write my source code in it, I am trying to follow this tutorial
    Java Programming for beginners in four hours

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,320
    Rep Power
    25

    Default

    compiler so that I can write my source code in it
    A compiler is a batch program that reads a source file(.java) and products either a .class file or some error messages on the console.
    You write source code in an editor or an IDE.

  5. #5
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    ok i am confused, I just want to start learning how to program in Java but I need a program to right my code in and I also want to be able to execute that code in a console, like in python, can you suggest what I need to download?

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,939
    Rep Power
    8

    Default

    Quote Originally Posted by liam251 View Post
    ok i am confused, I just want to start learning how to program in Java but I need a program to right my code in and I also want to be able to execute that code in a console, like in python, can you suggest what I need to download?
    My advice? Ditch the "4 hour" tutorial and read through the link I sent you instead, then move on to the basic Java tutorials. The link I gave you explains everything you're misunderstanding.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    You simply write your code in any text editor, notepad, notepad++, anything else that can save files as .java, then you compile with javac on the command line. Check the link provided for you, it's the best place to follow.

  8. #8
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    Don't you love recursion?

    "I just wanna learn Java"

    "Read the tutorial"

    "I just wanna learn Java"

    "Read the tutorial"

    "I just wanna learn Java"

    "Read the tutorial"

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,447
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Junky View Post
    Don't you love recursion?
    That's just iteration.

    kind regards,

    Jos
    DarrylBurke likes this.
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default trying out the other tutorial

    Quote Originally Posted by KevinWorkman View Post
    I'm not sure what you really mean- that's not really how the compiler works. Are you expecting a GUI of some kind?

    Recommended reading: "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)
    thanks for the link, things are looking a lot more clear, but i can't get the hello world program to work properly. [IMG]c/Users/Liam/Pictures/java/helloworld.jpg[/IMG]
    Last edited by liam251; 07-26-2011 at 10:28 AM.

  11. #11
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I'm not seeing an image. What's wrong? Errors? If so, copy/paste them here.

  12. #12
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    agh... finding difficulty in showing the image, basically in the command prompt I don't see a hello world message, instead it gives me a load of gibberish about java options

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Liam>
    C:\Users\Liam>
    C:\Users\Liam>
    C:\Users\Liam>C:\java
    'C:\java' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\Liam>java
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)

    where options include:
    -server to select the "server" VM
    -hotspot is a synonym for the "server" VM [deprecated]
    The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument

    -splash:<imagepath>
    show splash screen with specified image

    C:\Users\Liam>

  13. #13
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Did you save the .java file in the Liam folder? If not you want to learn to use cd and dir to move around. Dir let's you view the current directory, and cd let's you move to the argument.

    Java Code:
    dir
    cd ..
    dir
    Try typing that, then use those commands to get to where you saved the file. If you saved it in c:/java
    You can also just type
    Java Code:
    cd \java
    Next when you use java and javac(which is the compiler), you generally pass an argument in(which is the file)

    Java Code:
    javac yourfilename.java
    You may need to specify the classpath with the -cp flag
    Java Code:
    javac -cp . FileName.java
    Then if you type dir, you should see a FileName.class file, you run this with java, like this
    Java Code:
    java FileName

  14. #14
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    yep the .java file is in the java folder which is in the liam folder

  15. #15
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by liam251 View Post
    yep the .java file is in the java folder which is in the liam folder
    Okay? And, so, did you do the rest of things in that post? Which the tutorials do cover BTW, but that you seem to be deeming unimportant minor details, rather than the deciding factors that they are.

  16. #16
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    ok nvm, i now just moved the code into my c drive and I tried to run the program but it then came up with another error,
    Java Code:
    C:\java>java HellowWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError: HellowWorldApp
    Caused by: java.lang.ClassNotFoundException: HellowWorldApp
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: HellowWorldApp.  Program will exit.

  17. #17
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    And the advice about "-cp" ?

    Edit: Not that anyone said that you need to "move the code into your c drive" (whatever, exactly, that means).

  18. #18
    liam251 is offline Member
    Join Date
    Jul 2011
    Posts
    9
    Rep Power
    0

    Default

    errr, I did use the cd command at the beginning, if that's what you mean, I also checked if there were any syntax errors with the name of the program and I can't see anything wrong there. I changed the directory just to make things simple... this is kind of irritating since it should be working straight away......

  19. #19
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    not "cd", "cp". And that is a command option, not a command. Read that post again, as well as the tutorials.

  20. #20
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

Page 1 of 2 12 LastLast

Similar Threads

  1. Launch Jar from in application
    By hardcorebadger in forum New To Java
    Replies: 3
    Last Post: 01-25-2011, 06:03 AM
  2. Launch configuration
    By skittle in forum Eclipse
    Replies: 0
    Last Post: 02-28-2010, 11:57 PM
  3. Replies: 13
    Last Post: 01-24-2010, 10:58 AM
  4. Replies: 0
    Last Post: 01-18-2010, 02:57 AM
  5. Launch Error
    By roughjj in forum Eclipse
    Replies: 1
    Last Post: 10-30-2009, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •