PDA

View Full Version : What is Java for?



aysiu
November 3rd, 2005, 09:22 PM
I'm not a total idiot. I did a Wikipedia search (http://en.wikipedia.org/wiki/Java_programming_language), so I know it's a programming language, but what is it really for? Why do you need it if you do need it?

In other words, what practical applications are there for Java? What do you need it for? I'm not asking what you could need it for? I'm not using a rhetorical "you" here. I mean you specifically (anyone reading this thread).

I have yet to find a practical use for Java. I've never had to install the Java runtime environment, and when I turn Java off in my Firefox preferences, it never stops me from doing anything I need to do on the web.

So what do you use it for? Am I missing something cool?

bjweeks
November 3rd, 2005, 09:29 PM
Java as you know it a multi-platform interpreted language. Many programs nad web apps are coded in java(not javascript). So because it is multi-platform quite a few open source apps use it. Also MANY websites have java apps in beaded.

Things I can think of.;

1: Azureus the best bittorent app.

aysiu
November 3rd, 2005, 09:33 PM
Thanks for the quick reply. It didn't really answer my question, though. I mean practically (not theoretically) what's it needed for? Is there a particular application I won't be able to run without Java? Is there a particular website that won't function without Java?

xequence
November 3rd, 2005, 09:36 PM
Thanks for the quick reply. It didn't really answer my question, though. I mean practically (not theoretically) what's it needed for? Is there a particular application I won't be able to run without Java? Is there a particular website that won't function without Java?

I think java provides a good way to have online games and have them multi-platform. Like, my little brother plays runescape, and its java.

Other then him playing that, the only reason for me to have java installed is Azureus and Limewire, though Azureus more.

aysiu
November 3rd, 2005, 09:46 PM
If what you're saying accounts for Java's major uses, that could I explain why I've never seen a use for it personally. I don't really game, and I don't really Limewire/Azureus.

bjweeks
November 3rd, 2005, 10:13 PM
It is only used in web based games. No, java is very common I just can't think of any apps it uses.

aysiu
November 3rd, 2005, 10:19 PM
It is only used in web based games. No, java is very common I just can't think of any apps it uses. Thanks. I wasn't sure if I was missing something.

Stormy Eyes
November 3rd, 2005, 10:24 PM
Thanks. I wasn't sure if I was missing something.

Somebody mentioned Azureus, the bittorrent client. You cannot run Azureus without Java.

Kvark
November 3rd, 2005, 11:49 PM
The programming language itself is pretty good. Sun's JRE software on the other hand is not very useful, running a Java program in it is like running the Windows version of a Linux program in Wine. It's better to compile the Java program to a native program.

I personally needed it for everything from printing "hello world" to programming robots in programming classes at high school.

I still need to have it installed for exactly the same reasons I need to have Flash installed. Games, IRC-chat applets and other interactive stuff on some websites usually use either Flash or java. In those cases it's more convinient to let Sun's 'emulator' run it inside the Firefox window then to download and compile it to a native program.

poofyhairguy
November 4th, 2005, 12:19 AM
OpenOffice 2 uses it for the help and the "base" program I believe.

I need Java for an online grade reporting website.

blastus
November 4th, 2005, 12:29 AM
Java is used more for server stuff. BEA WebLogic, IBM WebSphere, and JBoss are widely used Java application servers. For example, eBay uses IBM WebSphere to run their auctions. My telephone company uses Java (not sure what application is running behind the scenes but it is Java Server Pages based) to handle accounts and process bill payments. My University uses Apache Tomcat (a Java servlet container) for handling student accounts. All this is transparent to the end user who just uses a browser to access the web sites (the end-user doesn't need Java.)

Java is also used on the desktop--though not as popular. Java is useful for Semantic Web applications. For example, the Protege Ontology Editor is a desktop application written in Java. Hewlett Packard's Jena package and the W3C RDF Validation service comes to mind. Java also has applications in 3D. NASA, for example, uses Java 3D on the web to model solar systems, planetary motions, exploring Mars and so forth. The University of Calgary Faculty of Medicine is using Java 3D for Bioinfomatics research. Java is also useful for programming electronics devices.

ember
November 4th, 2005, 12:33 AM
I am currently working on a project (well, not me personally because it is somebody else who deals with Java) which uses J2ME for a mobile GPS Suite - on PDAs Java is quite a reasonable choice.

imagine
November 4th, 2005, 12:56 AM
I'm not really sure what you mean with your question.
Java is a programming language, as C, Python, Perl, Visual Basic and thousand others. You develop applications with it, at least that's what you usually want to do with a programming language.
It's not used very often in desktop applications, so it could very well be possible that you have no programs on your PC that are coded in Java. However Java is often found on the server side and in mobile stuff, eg eBay makes heavy use of Java or more precisely Java 2 Enterprise Edition.

racecat
November 4th, 2005, 01:56 AM
Thanks for the quick reply. It didn't really answer my question, though. I mean practically (not theoretically) what's it needed for? Is there a particular application I won't be able to run without Java? Is there a particular website that won't function without Java?

I ran into one. I invest a little in the stock market. I sometimes use a stock screener to narrow down the selections when I'm looking for purchase candidates. The Nasdaq market website has Sharpscreen Online which requires Java runtime. If I remember correctly, I loaded it directly from the web page where it autoinstalled.

I think it's the only one I've run into, so far.

Bill

KLineD
November 4th, 2005, 02:10 AM
I need it to eat... I work as a Java developer.

But some of the apps you can find is for example jEdit, an excellent Editor/IDE. Someone already mentioned OpenOffice but there's also Matlab (thou both of these apps can run without java to some degree).

Also already mentioned, Java is very popular in the server side. I use it to develop web applications in an object-oriented fashion and that leads to better productivity in my experience. My bank use it for it's web applications and many more sites use it to provide dinamic content (look for the .jsp extension in your address bar to identify some of those sites).

But overall, I think your question is misleading. Java is a programming language. You can know nothing about Java and still benefit from some of the programs made with it (just like with any other programming language)

poofyhairguy
November 4th, 2005, 02:38 AM
If you ever used Ebay, you used Java.

aysiu
November 4th, 2005, 03:30 AM
So if I don't use...

games, Azureus, Limewire, eBay, OpenOffice, or some stock market thing, I don't really use Java, right?

Sounds about right. The closest I come is Pioneers (which, as far as I know, doesn't use Java) and KOffice.

arkangel
March 21st, 2006, 10:39 PM
Java is good only for doing Java IDE :P , well some of my favorite programs , maple or matlab uses it as Interfaces , I dont like it either but saves effort to the company , they have to progrma in java and it will run in any plataform that support it

Virogenesis
March 21st, 2006, 10:57 PM
Java is a object oriented programming langauge with fantasic networking support.
Its platform independent many mobile/cell phones come with java installed to play the little games.
Yahoo use java for their games.
Macromedia coldfusion uses java.
Zend php editior uses java.

JSP is java based and is used alot with servers as it provides a enterprise solution other than going the ASP route.
Java has its uses and does eat up resources but it does what no other lang can.

blastus is correct about java and servers.
Java has great xml support aswell

papangul
March 22nd, 2006, 02:05 AM
Java's platform independence feature is cool. I use a stock trading program which the broker house installed on windows. Later when I erased windows and started using linux exclusively I could use the same program file on linux(without using wine). This I can do because the program is written in java and java is platform independent.
Also earlier there was no ajax. So whenever some complex features were required in a webpage java applets were used.
Java is also meant to be used in gadgets and gizmos.

woedend
March 22nd, 2006, 02:20 AM
i like the idea, but i always find that java is painfully slow as a crossplatform base for writing applications.

papangul
March 22nd, 2006, 02:33 AM
Java was slow maybe five years ago. Nowadays slowness of java is more a myth than reality. On my machine a fairly advanced java program and gedit takes about same time to load. Also the blame for slowness goes partly to bad coding.

BoyOfDestiny
March 22nd, 2006, 02:41 AM
Java was slow maybe five years ago. Nowadays slowness of java is more a myth than reality. On my machine a fairly advanced java program and gedit takes about same time to load. Also the blame for slowness goes partly to bad coding.

Well dunno about gcj (which let's you 'compile' java further than bytecode that is normally use by an interpreter... I think? =) ).

If you need a jvm, a java virtual machine, that is some of the slow down, it's job is interpret the java byte code and "run" your program.

Other things that slow it down is automatic garbage collection, and things like bounds checking. Basically it makes java "safer".

Anyway, it's no myth that it is slower to run somethings in java... Let's say in a loop than in c++ (or assembler)... It's just machines have gotten faster. :P

papangul
March 22nd, 2006, 02:48 AM
My machine is five years old p3-750. Java runs fine here. No feel of slowdown. Technically it should be slow because of the 'interpretor' feature. But practically it doesn't count much if the coding is good.

endersshadow
March 22nd, 2006, 05:03 AM
Java's use to the end user is only as valuable as the programs that are written in it. Ergo, you need to ask, "Why would someone write in Java?"

Quite simply, for a few key reasons:
1. Interoperability. Well, that's a lie, Java isn't interoperable...but it's interpretted by the same rules that have different versions for the platform that it's on, so it gives the illusion of interoperability.

2. Object Oriented. It's a little...or a lot...easier to write than C++. It provides a little more powerful of an OO language than C++ from an ease-of-programming standpoint. It's still a high-level language, but you can grab the bull by the horns, so to speak, and use it for low level stuff.

It comes down to preference. Java is much more scalable than C++ or C, so that makes it good across the board from OpenOffice.org to that bowling game on your cell phone...but I'm still not a fan :-D

otake-tux
March 22nd, 2006, 05:25 AM
Someone mentioned java not being slow.

Does that mean the slowness of azureus is the developers fault?

I use 2 java programs. Jgrasp and azureus. Both are slow as hell.

endersshadow
March 22nd, 2006, 06:06 AM
Someone mentioned java not being slow.

Does that mean the slowness of azureus is the developers fault?

I use 2 java programs. Jgrasp and azureus. Both are slow as hell.

Yes, it's inherently slower than anything in C or C++ since it needs to run through an interpretter.

Note: Interpretter != Compiler

BoyOfDestiny
March 22nd, 2006, 07:45 AM
My machine is five years old p3-750. Java runs fine here. No feel of slowdown. Technically it should be slow because of the 'interpretor' feature. But practically it doesn't count much if the coding is good.

I believe you. But what I mean is side by side it's slower... However, the difference might be in milliseconds... So yeah, I haven't used anything in java that is dead slow (last time was 5 years ago actually, when I was taking a course using "bluejay"... java within java... *shudder*... Also to make this amusing, one of my friends had a mysterious error with her code... Turns out with bluejay, 0 and O looked identical... Hilarious!)

belikralj
March 22nd, 2006, 08:13 AM
As was said before so many times. Java is a language like any other programming language, except for one fact from what I can gather. It's compiled programs can run on virtualy any platform throu an interpreter designed for that platform while in languages like C and C++ the programmer must account for the differences in the way the Operating System handles data input/output streams and files. Because Java is so universal it is constantly gaining popularity and you will mostlikely encounter more and more applications in Java because of it's likness to C++ in power and it's ease of use. How ever Java does not have the same control over the computer that C and C++ hold and that is why I have chosen to learn C.
However this is my opinion and it may be missinformed, please correct me if you disagree.

blueturtl
March 22nd, 2006, 08:54 AM
In other words, what practical applications are there for Java? What do you need it for? I'm not asking what you could need it for? I'm not using a rhetorical "you" here. I mean you specifically (anyone reading this thread).

Here in Finland we have a movie theater chain called Finnkino (http://www.finnkino.fi/) which has online ticket reservation possibilites. You just pick a movie, time and date, and the number of tickets you're going to reserve/buy. Then you are forwarded to a screen with the physical layout of the theater hall and you get to click select your seats from this picture. This is done in Java, and I'm glad it is, because it works on any platform I'd want to browse the site from. I suppose there could have been another way of doing this, but Java supposedly makes it a whole lot easier.

3rdalbum
March 22nd, 2006, 09:07 AM
Java is a programming language whose source code is decended from a Windows 95 virus. It has three purposes: To frustrate mere mortals who try to program in it, crash your web browser, and make your computer run like a 386 Celeron.

otake-tux
March 24th, 2006, 02:30 PM
Java is pretty nice for applications like the theater program someone mentioned. It is also very nice to program for. I'm come from a C++ backround, now I'm learning java and Its so easy it should be illegal. Java does so much work for you.

Jimmy_r
March 28th, 2006, 01:34 PM
My experience too, when i came from C++ to java i thought java must be the best programming language in the world. But since i discovered python... well in my case python just knocks the socks off java :)

Reggaeton King
March 28th, 2006, 01:58 PM
As was said before so many times. Java is a language like any other programming language, except for one fact from what I can gather. It's compiled programs can run on virtualy any platform throu an interpreter designed for that platform while in languages like C and C++ the programmer must account for the differences in the way the Operating System handles data input/output streams and files. Because Java is so universal it is constantly gaining popularity and you will most likely encounter more and more applications in Java because of it's likness to C++ in power and it's ease of use. How ever Java does not have the same control over the computer that C and C++ hold and that is why I have chosen to learn C.
However this is my opinion and it may be missinformed, please correct me if you disagree.

C# is the same way for only for Windows.

adamkane
March 28th, 2006, 04:40 PM
Back in the day, Java was used to run cross-platform applications in the browser, and it sucked. Now information is served to the browser with server-side scripting (PHP, Ajax, etc.). The browser has become the interface to the application on the server, rather than running a client application directly in the browser.

BWF89
March 28th, 2006, 10:44 PM
I didn't read through the 4 pages of replies but Java was origionally created to be apart of Sun's Java Desktop operating system I believe. The idea was that if you made an app for Java Desktop OS since it ran completely in Java you could also run it on Windows, Mac, Linux or anyother platform Java supported.

Their slogan was "Program once, run anywhere" but alot of the programmers replaced that with "Program once, debug everywhere" or something like that.

hajk
April 8th, 2006, 02:36 PM
As a general purpose programming language.... a matter of taste, really. Java was the great and coming thing 10 years ago, but then was interfered with by C# and you-know-who. Same thing may happen if Perl/Python/Ruby/... get too popular. :rolleyes:

But Common Lisp may be safe, I hope... ;)

GarethMB
April 8th, 2006, 03:50 PM
I need it for azureus.

jeffjj
April 8th, 2006, 04:00 PM
I program in Java every day. I think it is an incredible programing language, but mainly for server-side code. When I think of Java I think of Spring, Hibernate, Tomcat, etc...

The only time I think about it as a client language is when used with a better toolkit like SWT, which is a product of the Eclipse project. The nice thing about SWT is it uses the native look and feel of the OS. So on Windows it looks like XP and on Ubuntu it looks like Gnome. SWT is also quite fast. Swing, on the other hand, is very slow and looks aweful. With each release it does get better, and on the latest JDK it even looks pretty attractive, but it does not compare to SWT. I am not sure why there are not more SWT apps on Gnome, but I assume it is because the toolkit does not use the GPL license.

That aside the one thing I love about Java on Ubuntu is the Eclipse IDE. The lack of a killer IDE in Gnome is one thing I think is unfortunate for any of the standard languages such as C or Python. I know I will probably hear back about emacs or anjuta, but those do not even come close to stacking up. With Eclipse you have a modern IDE that understands the language. For those that have not used it before you are really missing out.

There is also the camp that thinks that you should learn the language, not an IDE. I used to agree with this as years ago you spent as much time fighting the IDE as you did learning the language. However, now a great IDE will help you learn the language as the editor helps you out with all the syntax. For example, if you cannot remember a class or want to "see" into a class just alt-space and hit enter.

I tried to get into C programing with the GTK toolkit but I couldn't deal with going back to such a primative development environment. All that typing was annoying beyond belief. Plus I now take it for granted that I can refactor methods and variables at will and the IDE just fixes everything. Although I did enjoy the GTK toolkit itself as everything just worked as promised.

Another thing is compiling code. As a developer I almost feel dumb about saying this but with Java (and Eclipse) the whole compile process is moot because every time I hit save it compiles on the fly. To build my code for production I use ant. With C not only is compiling non-transparent but you have to become a master at learning Make files.

I am interested in Python as the compile process is again transparent and the syntax looks interesting, but I would want a better IDE. I did see there were some commercial ones that seemed pretty inexpensive, but have not tried them out yet. If someone who knows what a powerful IDE is and can point me at one that is particularly great I would be willing to try it out.

More so I am interested in C# with mono. It seems like a language that would be a better fit for me and they are working on a better IDE. I have been reluctent because C# wierds me out as it is associated with MS. However, I am tired of the noise and just want to try it out.

Ok, so I got off topic somewhat. Java is a great server side language. I also hear it is a good mobile device language. There are even projects out there that use C++ for the front end graphics, but then use Java as the engine for the logic. Most Java developers do not think of Applets or Swing as they are not that great. This posts makes me think non-Java developers are very misinformed. However that is understandable as all you can physically see is the few Swing apps out there. Swing technically is an awesome toolkit, but the reality is it slow, although improving. But who cares if it is improving at this point...Swing had their chance and they blew it a long time ago.

Open source has had a huge impact on Java. Just about every development tool or toolkit I use is open source. This for me is discouraging as at work we use Windows when what I really want is Ubuntu. All my tools work perfectly on both so it is sad that I am forced to use that other OS for no other reason other than that is what the company supports. As long as they do not find the rogue Ubuntu server I can deal though :).

On a side note the apache project is developing an open source version of Java called project Harmony. It would be based on the JDK 1.5 specs. If they pull it off I think that would be wonderful as it would give the open source world another great language that is completely open source and not controlled by any company.

ComplexNumber
April 8th, 2006, 04:07 PM
I know I will probably hear back about emacs or anjuta, but those do not even come close to stacking up. With Eclipse you have a modern IDE that understands the language. For those that have not used it before you are really missing out.
eclipse has a tendency to crash a lot (and its slow). anjuta doesn't.

njf
April 8th, 2006, 04:44 PM
eclipse has a tendency to crash a lot (and its slow). anjuta doesn't.
It is slow in starting up and loading plugins. But I can say that it is rock solid. Note that I use the sdk from eclipse.org and j2sdk from sun.

Sirin
April 8th, 2006, 06:24 PM
It is only used in web based games. No, java is very common I just can't think of any apps it uses.

Limewire uses Java. :)

jeffjj
April 8th, 2006, 10:01 PM
eclipse has a tendency to crash a lot
Well thats a LOAD OF CRAP (FUD) if I ever heard it!!! I use it literally every (EVERY) day and it has not crashed once the whole time I have used Linux the last few years! I heard it is in the repositories so maybe that has something to do with your experience. I always use the download from the Eclipse site as it is just a simple unzip and then works right off the bat.

Sorry if that sounds harsh but I cannot believe you just said that!

I really wanted to like Anjuta but it doesn't have any features. I guess it did teach me that you do not need a kick butt IDE to get something to work...but if you want to really be productive you do. I guess I am in the camp that good enough is not good enough. I believe a lot of open source tools are better than the commercial equivalent which is why I use them. For instance if I didn't really think Ubuntu was better than Windows I wouldn't bother. One of my points is that for all the great open source tools the IDE is not one of them...at least not for C or python. KDE has their toolkit for C++ which I hear is quite nice, but GNOME is still stuck on good enough is good enough.

ComplexNumber
April 8th, 2006, 10:24 PM
jeffjj
try eclipse on fedora core 4(especially), suse and mandriva. then you'll see things my way.

BoyOfDestiny
April 8th, 2006, 10:54 PM
jeffjj
try eclipse on fedora core 4(especially), suse and mandriva. then you'll see things my way.

If you only have trouble with it under those distros... Why blame eclipse? Run it with ubuntu and see how it fares.

ComplexNumber
April 8th, 2006, 10:57 PM
If you only have trouble with it under those distros... Why blame eclipse? Run it with ubuntu and see how it fares. because they'make up about 90% of my experience with linux. ok. i'll try it on ubuntu.

adamkane
April 8th, 2006, 11:24 PM
Enough of the anjuta good, eclipse bad garbage. This is the first Java thread, where I actually started to learn something about Java.

Java is a server-side, enterprise class language, and is a little bit intimidating, so most of us haven't been able to dip our toe in the water yet.

Keep it constructive.

3rdalbum
April 9th, 2006, 05:46 AM
On Linux, Java's purpose is to teach newbies about ways to install software other than repositories

On Mac OS 9, Java's purpose is to remind users to restart the computer from time to time. Or rather, force them to.

On Mac OS X, Java's purpose is to allow hackers to get into the computer. (seriously though... almost 40% of OS X security flaws are due to the JRE!)

On Windows, Java's purpose is to show users that there IS a difference between home-built/locally-built computers and brand-name machines. (by the way, has anyone actually written a Java program that runs on all Windows PCs with the latest JRE?)

jeffjj
April 9th, 2006, 06:38 AM
Keep it constructive.
Your right! My posts were very unproductive...I think this post caught me having a bad day. I apologize :(.

I do plan on spending the summer learning C# (mono), PHP, and hopefully some Python. Maybe I can report back on what I like about those languages. I do really like the open source toolkits such as GTK and QT. I have very limited experience in any, but when I tried to do anything in any of those everything worked as promised.

So, to carry on the nature of this thread if you want to use a good client toolkit I would recommend SWT at http://www.eclipse.org/. They have some nice tutorials to get you started. If you go to Sun at http://java.sun.com/ there is quite a bit of information about how to get started with Swing if you go that route. Technically Swing is a nice toolkit and you could learn quite a bit.

Almost all Java developers (that I know of) use Java for server side coding though. The big thing the last few years is what is known as lightweight frameworks to speed up development while being very robust. They are used for building the back end infrastructure for web sites. The most popular ones are Spring, Webworks, and Struts for open source. There is also JSF which is Suns and is free. I have been using Spring and really enjoy it.

Then you would need a database abstraction in which a lot of developers use Hibernate as a layer between the database and your business logic. There are other good ones too but Hibernate has the momentum.

The view layer in which you present information to your users in the browser has many different choices. JSP files are the most common and is the Sun standard. At apache.org another very popular choice is Velocity templates. If you do not need anything dynamic just regular html files work too. The push right now is to not have any real code in the view so the view is less exciting...that is until AJAX has come along. AJAX is a story in itself but it just combines some standard web technology and pushes it to the limits to create a dynamic web page in which you can make the request/response transparent to your users by not requiring a page refresh to get new data.

To serve up the web pages you use a servlet container, in which Tomcat is one of the more popular ones and is part of the apache.org software in the Jakarta directory. There is also a plugin in which the apache server can route web traffic through Tomcat to serve up web pages.

What is interesting about all this is the Java standard is now shifting towards to what the open source frameworks showed everyone is possible. This is also my daily life in a nutshell! Pretty exciting, but also quite a learning curve for so much technology. We actually use quite a bit more technology than this, but this kind of gives a short tour.

Hope this was more productive :).