• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Java beginning

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I instal jdk what is next step?
 
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you wish to do?

Does this help you? http://www.jibble.org/settingupjava.php
 
Goran Dre�njak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want compile programs in cmd!
 
Ranch Hand
Posts: 116
Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sun has really good tutorials, starting from where you are. See:

Java Getting Started Tutorial
 
Svend Rost
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to follow the instructions in the link I posted.

When you have installed JDK and updated your PATH try to
open a command prompt (DOS, xterm ect.) and type
"java" and "javac".

If you've set the path correct you wont get a message
a la "java is not a regocnized command or filename".

To compile a Java file do the following:
1) create a file, e.g. Hello.java
2) open the file and start typing java code, e.g.

3) goto the directory that contains the file you created
4) type "javac <filename>", e.g. javac Hello.java
the file will then be compiled and a class file will be
generated which can be executed.
5) If the file compiled without errors type: "java File",
e.g. "java Hello" which should print "Hello World".

/Svend Rost
 
Goran Dre�njak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I see that tutorials but they dont help mee!
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you finding difficult? If you can't understand any of the tutorials, you might have a problem. If there are certain parts of the turorials you don't understand, feel free to ask quesitons about them here. Someone will probably help. Or if you are stuck with something not mentioned in the tutorials, post a question about that and someone is liable to help.
 
Goran Dre�njak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem is on cmd!
I instal java then I create file hello world, but I dont now how to set path and Svend told me type "javac<filename>" , where I shoud type this?
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah so it is an OS problem, not a Java problem. I'll assume since you mention cmd that you are using Windows. You will need to make sure that you JDK/bin directory is in your PATH. This is how Windows finds executables to run. With Windows you have two ways to set the path:
  • By calling SET PATH=[whatever your path is] from the command line. This has the downside that it is only set for the lifetime of the command window.
  • By setting the path as an environment variable. How you do that depends on which version of Windows you have. XP is the current version so I'll use that as the example: got to Start>Settings>Control Panel>System, click on the Advanced tab, then the Environment Variables tab. Set it in there.


  • [ November 15, 2006: Message edited by: Paul Sturrock ]
     
    lowercase baba
    Posts: 13091
    67
    Chrome Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Please don't make the same post more than once. I just spent some time answering in your other post, only to find the discussion over here.

    I have deleted your other thread - now you'll never know what i had to say!
     
    Svend Rost
    Ranch Hand
    Posts: 904
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Goran Dre�njak:
    Problem is on cmd!
    I instal java then I create file hello world, but I dont now how to set path and Svend told me type "javac<filename>" , where I shoud type this?



    I'll try to elaborate on what I wrote earlier.

    1) Create a file called Hello.java in c:\code\
    2) Open the file and insert some java code
    3) Save the file
    4) Open cmd
    5) Type (in cmd)
    "cd\"
    "cd code"
    "javac Hello.java"

    (without the "'s)
    This should compile the java file. Try to run it by typing: java Hello
    (your still in the same directory, i.e. c:\code\)
     
    Java Cowboy
    Posts: 16084
    88
    Android Scala IntelliJ IDE Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    The "Hello World!" for Microsoft Windows tutorial explains in very small steps exactly what you should do. Did you read it? It's the first tutorial in the link that Chris gave you above.

    If you do not know what the Windows command prompt window is or how to use it, see this:

    Introduction to the Windows Command Prompt
    Windows Command Prompt in 15 Minutes
    How to use an MS-DOS Prompt window

    (find more yourself with Google).
    [ November 16, 2006: Message edited by: Jesper Young ]
     
    Get me the mayor's office! I need to tell him about this tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic