Results 1 to 12 of 12
  1. #1
    Xarver is offline Member
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default Java Questions...

    1.)
    I have a Windows XP and Linux[Kubuntu 8.04]
    Java won't install on Kubuntu and I have no idea how to install it.
    I looked up some tutorials, I found some, installed Java, but it doesn't work.
    Is it that KDE sucks, or me? :eek:
    Will Ubuntu/Gnome work better?

    Well on the Windows XP it works, anyway...

    2.)
    Also, I'm wondering if Java is right for me.
    I want to make games and applications... [GUI Programming]
    Java applets look good but they are in HTML code...
    I don't want my applet on the website,
    I want it to be downloaded and played.
    Example) - I downloaded the exe and I'm ready to play!
    Or is it somehow possible to have it on the website,
    but all the data is stored on the user's computer?

    3.)
    One last question...
    I need good beginner tutorials and stuff that can get me started.
    I want a tutorial that teaches gets me to an Intermediate Java Programmer,
    and teaches me about apples, creating software, creating games, etc...
    Or you can just give me a link to a few tutorials...
    Ebooks are cool too!
    [Not really any good programming experience... ]


    Any help appreciated!!!

    ~ Xarver :)

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    1. I've no experience with Java and Ubuntu other than I've seen Ubuntu folks on the forums talking about their java programs.

    2. No exes are made with standard Java, but you don't want exes which are limited to one os. Jars are easy to make in Java and will fill the role that you are looking for.

    3. The best java tutorial is free: the Sun Java Tutorials

  3. #3
    cynosureepr is offline Member
    Join Date
    Sep 2008
    Posts
    8
    Rep Power
    0

    Default

    I don't know the answer to #1..
    but;

    #2; you'll want to make them into JAR files.. I know a lot of IDE's basically do this for you. I don't know which ones, or how.. but I'm sure google has all more than enough answers.

    #3; I haven't gone through 'Sun's' Java tutorials.. but I bought this book called "Head First Java" published by O'Reilly.. everyone swears by this publisher, and the book. I've only gotten into two chapters.. but it already seems a lot less boring than the books I've had to purchase for my Computer Science Java programming classes!

    =)
    may you have better luck in learning java than myself! =P

  4. #4
    Xarver is offline Member
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default

    I have a question about all the filetypes.
    A .java file I'm guessing is the source
    A .class is the executable?
    A .jar file contains files and runs as an executable?

    Can I double click a .class file and run it?

    Can I double click a .jar file and run it?

    :confused:

  5. #5
    cynosureepr is offline Member
    Join Date
    Sep 2008
    Posts
    8
    Rep Power
    0

    Default

    A .java file is the source. This is what you compile to get the .class file.

    From what I understand, I think the .class is just 'Java speak' .. it's what the compiler turns your code into so that the JVM can read it and execute it when run it. From my journeys, I haven't been able to double click the .class file and run it. It just opens a text file. You have to go to the CMD prompt and actually run the name of the file.

    And you are correct on the .jar. It holds the files and runs the program from the JVM.

    Someone correct me if I'm wrong on any of these. =)

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Xarver View Post
    I have a question about all the filetypes....
    You're welcome, by the way.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by Xarver View Post
    I have a question about all the filetypes.
    A .java file I'm guessing is the source
    A .class is the executable?
    A .jar file contains files and runs as an executable?

    Can I double click a .class file and run it?

    Can I double click a .jar file and run it?

    :confused:
    *.java is the source file, as you said. It's the file extension which you have to use in files that write your application. You can write a simple java code in word pad, text file and so on. Then simple change the file extension to java.

    *.class file the byte code, or machine code, or the binary file. So it contain streams of binary value. You can see/read in simply. If you open it on notepad you can see some annoying characters. Your PC can't directly understand the java source code. So you have to convert it to binary file, that is the *.class file. JVM do it for you by compilation.

    *.jar file, yes, in simple word I can say that it can execute by double click. But actually you have to do few things. *.jar is the distribution package use in Java.

  8. #8
    Xarver is offline Member
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default

    Thanks everyone, that really helped!

    Can anyone tell me how to make a JAR file? :)

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

    Default

    To make a jar file, use the jar command. It's documented in Sun's JDK doc. There are probably examples you could search for here on the forum.

  10. #10
    Xarver is offline Member
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default

    I made one :)

    The only probably is I don't see the output,
    any easy way to make it pause?

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

    Default

    Make what pause? What output? Are you getting an error message when you open the jar file by double clicking on it? On windows, open a command prompt, cd to the directory with the jar file and enter:
    java -jar <jarname>

    If you want to see the contents, a jar file can be read by WinZip on Windows. Not sure what utility program works on Linux. Try renaming the jar file to .zip and opening it.

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by Xarver View Post
    I made one :)

    The only probably is I don't see the output,
    any easy way to make it pause?
    Is that you application have any output to show? If it's on to the console either you have to run the jar file on command prompt or you have to enable the Java console.

    What you want to pause, can you clarify it more?

Similar Threads

  1. Few Questions about java
    By Grom in forum NetBeans
    Replies: 11
    Last Post: 09-13-2008, 02:26 PM
  2. 2 simple java questions
    By jimJohnson in forum New To Java
    Replies: 2
    Last Post: 02-02-2008, 09:35 AM
  3. Replies: 0
    Last Post: 01-24-2008, 07:53 PM
  4. A few questions about Java and design
    By ldb88 in forum New To Java
    Replies: 4
    Last Post: 12-07-2007, 12:51 AM

Posting Permissions

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