Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 5th, 2008, 11:57 PM   #1
IisNoob
Newbie
 
IisNoob's Avatar
 
Join Date: Mar 2008
Posts: 4
Rep Power: 0 IisNoob is on a distinguished road
Send a message via AIM to IisNoob
Java on a large scale...

I always hear people talking about Java web uses...I'm a highschool student, and I'm in a Java class and I'm not horrible at it but I could be better. Anyways I don't really understand stand alone Java because, when I compile (I use blueJ) its not like C++ where I see an exe and I can run that directly...I can only run this code I keep writing , through this editor... and since obviously not every one in the world has blue jay on there computers, they could never utilize the code I write. If someone could just explain stand alone java as versus web java that would be awesome
IisNoob is offline   Reply With Quote
Old Apr 6th, 2008, 12:31 AM   #2
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 272
Rep Power: 2 Jabo is on a distinguished road
Re: Java on a large scale...

for a Java program to run alone, within the program class, it should have a main function or method just like in C++. To compile the program, you need to go to command prompt, browse to the directory where your class file is, and enter "javac Class.java" at the command prompt; whereas Class.java is the name of your class file. Once it compiles without error, you can run the program with "java Class.class" at the command prompt.
More info

Last edited by Jabo; Apr 6th, 2008 at 12:43 AM.
Jabo is offline   Reply With Quote
Old Apr 6th, 2008, 7:37 PM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: Java on a large scale...

Your IDE is just a pretty interface to stuff going on behind the scenes.

You enter code. The code gets compiled in to some number of 'class' files. Sometimes, these class files are wrapped neatly in to a 'jar' or 'war' package - just an archive of classes, possibly other stuff too. Your IDE may have a very convenient 'run' button - this translates to compiling the code and then running it. End users do not need your IDE. You simply need to distribute the resulting jar/class/etc. There is an output directory which has these files in it. I have never used blue jay before, but I recall that it is some kind of gimped learning tool. Most any real tool, however, makes it very convenient to wrap your project in to an executable jar. This is exactly the same as a normal jar, but with the additional requirement that one of the class files is the startup class and that class file contains a suitable 'man' function. In most configurations, an executable jar can be run by double clicking.

'Web' java works the same way as standalone java. The difference is how things are started and what you then do.
If you have written a java applet before, recall how they are structured. There is an 'applet' base class which defines certain methods which you may want to override, such as repainting. There is no need for a 'main' function, certainly not a static main function. Rather than calling a 'static' (not associated with an object) method as main is, the program hosting the applet will create an instance of your specialized applet class. It's just "an applet." The program knows that it contains "applet" methods. It can be treated like any other object - it just happened to have been loaded on demand.
"Servlets" (think 'server') operate the same way. There is some particular class that the 'servlet container' expects to deal with. The container will load your specialized servlets, which will respond to web requests just as your applet may respond to drawing events.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Apr 7th, 2008, 4:37 AM   #4
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
Re: Java on a large scale...

you alwasy have to have a JRE to beable to run java, or the hardware to do it.
__________________
i dont know much about programming but i try to help
mrynit is offline   Reply With Quote
Old Apr 10th, 2008, 9:05 PM   #5
IisNoob
Newbie
 
IisNoob's Avatar
 
Join Date: Mar 2008
Posts: 4
Rep Power: 0 IisNoob is on a distinguished road
Send a message via AIM to IisNoob
Re: Java on a large scale...

Ty all of the responses have helped me see the real use for java, and I have stopped using Blue J and started using netbeans.
IisNoob is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming with Java: Tutorial ReggaetonKing Java 7 May 20th, 2008 10:58 AM
Special browser in Java (Project) stalefish Java 3 Feb 9th, 2008 4:22 PM
First Java Program duale2005 Java 3 May 22nd, 2006 5:17 PM
Java programmers, game developers, artists, be ware! RPG game team is recruiting! atcomputers.us Paid Job Offers 7 Sep 25th, 2005 7:25 PM
Begin my first lesson to learn Java satimis Java 7 Mar 3rd, 2005 2:45 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC