Home Forums Gamescan Chat42 About
* Login   * Register * FAQ    * Search
It is currently Mon 10-13-2025 4:00PM

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Easy Java Code Help
PostPosted: Thu 12-02-2004 7:31AM 
Offline
"para-dime"
User avatar

Joined: Tue 09-11-2001 2:34PM
Posts: 1084
Location: Off Campus (i.e. not hell)

Source: VPN
Hey all you 1337zors

I have some pretty easy Java questions that I would like answered. I've never programmed in Java, and now I ahve a program due in it...in a 300 level course. Good times.

Basically, to get me started, I need to know how to write/run a Java program. I'm sure I can probably use notebook or something to write it but I don't have any software like VC++ for Java on my computer to run it, so what do I do to go about getting started?

Secondly, I have to use this Java to write an XML file. Which is just outputing a bunch of strings to either the command prompt, or in my case, a file stream. How do I open up a file stream in Java and output text to it? A sample of code that I could use the answers to the first question on would be great.

I think this should get me started, I might write back later with more questions if I choose to make the program more than barebones. I have a decent amount of experience with C and C++ so the concepts of programming are no problem, just syntax. I know I could use Google, but I've been up all night already on another assignment and am crashing for a bit. Having an answer when I wake up to work on would be great.

Thanks for the help in advance.

_________________
People with doctorate degrees get to be called Doctor. So yes, I guess I am your Master... bitch


Top
 Profile E-mail  
    
 Post subject: Re: Easy Java Code Help
PostPosted: Thu 12-02-2004 9:46AM 
Offline
Colonel
User avatar

Joined: Mon 04-15-2002 4:23PM
Posts: 516
Location: Far, far away from Rolla (Colorado to be exact)

Source: Off Campus
Paradigm wrote:
Hey all you 1337zors

I have some pretty easy Java questions that I would like answered. I've never programmed in Java, and now I ahve a program due in it...in a 300 level course. Good times.

Basically, to get me started, I need to know how to write/run a Java program. I'm sure I can probably use notebook or something to write it but I don't have any software like VC++ for Java on my computer to run it, so what do I do to go about getting started?

Secondly, I have to use this Java to write an XML file. Which is just outputing a bunch of strings to either the command prompt, or in my case, a file stream. How do I open up a file stream in Java and output text to it? A sample of code that I could use the answers to the first question on would be great.

I think this should get me started, I might write back later with more questions if I choose to make the program more than barebones. I have a decent amount of experience with C and C++ so the concepts of programming are no problem, just syntax. I know I could use Google, but I've been up all night already on another assignment and am crashing for a bit. Having an answer when I wake up to work on would be great.

Thanks for the help in advance.


To get started go to http://www.javasoft.com and get the Java Development Kit (JDK) 1.5 (or another version if you need that...I think 1.5 has a lot of really cool new features to it). If you want a good IDE NetBeans is free and does a good job. Don't get the version where they bundle the JDK with it though. For XML stuff get JDOM (3rd party library, http://www.jdom.org)...it makes dealing with XML stuff very, very easy.

_________________
That's right. I'm gone. Rolla couldn't hold me. If you are still there, I know your pain. But I'm still going to laugh at you from far, far away. :-P


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Thu 12-02-2004 2:20PM 
Offline
"para-dime"
User avatar

Joined: Tue 09-11-2001 2:34PM
Posts: 1084
Location: Off Campus (i.e. not hell)

Source: VPN
Well, I got JDK 1.5, looks alright, kinda figured some stuff out. But if I wanted to use the java executable to run a java class (lets call it Simple, and it has the public static void main(String args[]) statement inside of it, where do I put the file so that I can run

java Simple

and have it recognize the class??

_________________
People with doctorate degrees get to be called Doctor. So yes, I guess I am your Master... bitch


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Thu 12-02-2004 11:11PM 
Offline
Colonel
User avatar

Joined: Mon 04-15-2002 4:23PM
Posts: 516
Location: Far, far away from Rolla (Colorado to be exact)

Source: Off Campus
Paradigm wrote:
Well, I got JDK 1.5, looks alright, kinda figured some stuff out. But if I wanted to use the java executable to run a java class (lets call it Simple, and it has the public static void main(String args[]) statement inside of it, where do I put the file so that I can run

java Simple

and have it recognize the class??


http://www.captain.at/programming/java/ ... cation.php
Create a JAR file and it will run like any other executable, except through the Java Runtime.

_________________
That's right. I'm gone. Rolla couldn't hold me. If you are still there, I know your pain. But I'm still going to laugh at you from far, far away. :-P


Top
 Profile E-mail  
    
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group