|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Beginner Info!!!
Hello I am not even a beginner yet but I have a few questions about Java. I would like to know what purposes does Java serve.
Example: what is it used for, web based applications, software or both? I would also like to know if its a compiled language or can you use a text editor. If it is a compiled languages then is there any free ware compilers. Everything else I think I can handle as far as researching the language itself. Thanks for any info. ![]()
__________________
---Official Member Of The Itsacon Fan Club--- ![]() Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day drinking beer. |
|
#2
|
||||
|
||||
|
about Java, its history and its purposes
You should take a look at java.com. This website is dedicated to the consumers of Java. You can download the JRE or Java Runtime Environment for free. You will need this if you want to run a java application on your PC.
Furthermore, if you're interested in the history of Java, you can take a look at the "inside story". And there is a link to "java everywhere", which will show you where Java is used. A very nice book is "hello world(s) - from code to culture" which gives you an overview of the 10 years of Java. You can take a look at it at Sun.com Java comes in 3 different flavors : JSE, JEE and JME or Java Standard Edition, Java Enterprise Edition and Java Mobile Edition. JSE will let you make web applications or desktop software on your PC. As soon as you have big transaction applications, like financial software, you should take a look at JEE. JME is made for all the mobile devices, like mobile phones, PDA's. And Java can even be on a small chip like the one you find on a smart card. This Java smart card is used to make the eID in Belgium, my homeland. So, you can see that you will find Java almost everywhere on this planet. And beyond : Java gave the mars rover its eyes. Java has already left earth. |
|
#3
|
||||
|
||||
|
about the Java Virtual Machine
The purpose of Java in one sentence is "write once, run anywhere". To give you an idea what this means : I made a Java web application under Windows. After that, I transferred the classes to a Linux server without recompiling it. And it worked the same way as my local version under windows. Without having to rewrite or recompile it.
How does this work ? Imagine, there was only one computer with one operating system and one kind of processor. It's about the big dream of Microsoft, I guess, but that's not the reality. Anyway, the people of Sun made a Java Virtual Machine that makes any kind of Java program run on whatever computer is underneath. This Java Virtual Machine is an abstraction of the collection of computers you'll find. So, there is a JVM for every combination of OS and processor : Windows, Linux 32 bits, Linux 64 bits, OS/400... When you download the JRE or Java Runtime Environment which contains the JVM, you must choose the JRE for your operating system. |
|
#4
|
||||
|
||||
|
My 2 cents:
Java is a compiled language, although not to machine code of a specific processor but to the bytecode of teh virtual machine, that's why it is 'platform independent'. You can still use a text editor to edit the source offcourse At java.sun.com you can get the JDK (Java Development Kit), i.e., the compilers, for all versions for free. The JDK's contain command line compilers. There are many IDE's out there already, I recommend the excellent _free_ ide called eclipse (eclipse.org). |
|
#5
|
||||
|
||||
|
About the Java compiler, IDE's and stuff
If you want to develop Java programs, you should go to http://java.sun.com/ There you can download the JSDK or Java Software Development Kit. This is bigger than the JRE since it contains the javac command : javac stands for java compiler. And it's free to download the JSDK.
How do you write Java programs ? Well, all you really need is a free text editor which comes with most of the operating systems : notepad for Windows, vi for Linux. And if you've downloaded JSDK, you have your java compiler "javac". That's all you really need. But you can make life easier by downloading an IDE or Integrated Development Environment. This IDE will show you the errors, will let you debug. There are a number of free IDE's for Java like Eclipse, Jcreator, JBuilder, Gel and I'm pretty sure I forget a lot of other free IDE's. Since you're not a beginner yet, I won't go into details here. If you want do develop java web applications, you'll need a servlet container. And there is one free to download available : Tomcat. In need of a database ? There are free versions also, like MySQL. So you see, if you want to start to develop java applications, it won't have to cost you a lot on licenses. You can do your study work without having to give any money to the software providers. Which leaves you with a budget big enough to buy some books. And even there, you can find ebooks and tutorials for free on the Internet. "Thinking in Java" from Bruce Eckel is a very famous book, that is free to download. |
|
#6
|
||||
|
||||
|
about MHP
You can find Java even where you would not expect it at first. For example, MHP stands for Multimedia Home Platform. This is a subset of Java made especially for the iDTV or interactive Digital Television.
What is the purpose of iDTV ? It will allow people to ask for a program or a movie on their screen when they want it. Not when the TV company broadcasts it. |
|
#7
|
||||
|
||||
|
Man gertcuppens, you definately did a lot more than I would have thought. I appreciate all that information. This was exactly what I was looking for. Thx for the tips too Icon. Both you guys were a big help. I think I am going to go get a book now and get started.
Im sure you will be hearing from me in a little while lol. |
|
#8
|
||||
|
||||
|
Another useful place for java information is http://www.javaranch.com/ (the Big Moose saloon), they also have a lot of information on certification, sun recommends this site themselves.
Gertcuppens, have you done a lot with the Swing classes? |
|
#9
|
||||
|
||||
|
Thx man but now I am having another small problem. I have downloaded the developer kit and sdk for java, You know the j2se 5.0. First off is that the right one for developing java applications and applets? If so - is there an easier way to compile each program. I changed the directory in the comand prompt to the location of the program. I have the exact source code from a book, but it errors unless I put the file in with the folder that the .exe is in. Is that normal or have I got something screwed up. Also I cannot use java <program name> to run my program. Is this normal, I cannot find the right .exe to use to run them. I have only a .java file so far no html or nothing else. Keep in mind this is after it has been compiled and when i try to run it, I get an error that says ERROR in "main" class something something not defined.(sorry for the fudge on the error code, IM at work).
Some help would be nice that is if Im at all understandable. So in short I guess I just need help configuring this compiler that is if I even got the right one.... |
|
#10
|
||||
|
||||
|
I'm at work too so I don't have much time to explain things very elaborately. First off: you haven't screwed up. For issues with where your files are when compiling you should read up about the classpath. This is either a compiler flag or an environment variable which tells the java compiler (javac) and java itself where your files are.
Now when you compile java source you produce .class files. Java programs run on a java virtual machine (JVM) and therefore Java does not produce executables. This might seem strange at first. You always need a VM to run java programs, in your case you start it with 'Java <classname>' (classname = without .class or .java), in the case of an applet or server page your browser/server will have a JVM. As to your error, you should check your classpath, I'm almost sure that's where the problem is. Sometimes it's enough to just run 'java -classpath . MyClassName'. If you have more trouble just ask, from all the languages I know I really like Java the most. Good luck! Last edited by Icon : January 31st, 2006 at 12:22 AM. |
|
#11
|
||||
|
||||
|
Thanks Icon I appreciate the help man. I have found a way to do this for now. But I am definately going to try what you are saying because the way I am doing it for now is a little crappy. I just pull the file over the javac.exe and it compiles it. and places the .class in the folder of the .java file i just pulled over it. =). The mac way.. Is java just like. The only problem now and Im sure its just like C++ but when i do java then <program name> it runs then it comes up and goes right away. Do you have to put a system("PAUSE"); in there some were lol. or does java support anything like that. Thx for the help man, as always.
![]() |
|
#12
|
||||
|
||||
|
You could go for Runtime and exec() and stuff but an easier way might be to:
System.in.read(); or something.. I never need this, I work from a terminal, the linux way Hint: read() throws a checked exception. By the way, you probably knew this, but here: http://java.sun.com/j2se/1.5.0/docs/api/index.html you can find the API for Java. |
|
#13
|
||||
|
||||
|
Thx for the tips Icon...
I will try that.No I didn't find that yet. THX. I have only started like three days ago, well actually at the start of this thread. So, I have really just been researching the uses for the language and not really the syntax. But let me see if I got this correct, and I know you know C++ too but are those basically the same as includes just for java? I'm only on Chapter three of my book and we are just now at inputting data. Its kinda boring and hard to follow because its a lot like C++ and I think I'm too smart to read it cause I think I know whats coming next lol. But I'm force feeding myself its the only way, because I know I definitely don't know it all .. |
|
#14
|
||||
|
||||
|
Aww Man That eclipse compiler is awsome. Its kinda like Dev in a way, and brings the functionality of a regular compiler to java instead of just using a text editor. I like it, thx for that one ICON if my rep points link wasn't broken I would give ya some.
![]() Well I guess they fixed it ![]() |
|
#15
|
||||
|
||||
|
Well for starting with Java eclipse might not be the best, some subtleties will be lost on you, but after the first tutorial and a few couple of times of command-line compiling (check out how to do packages from command-line) then you should leave the command line far behind imho.
Eclipse rocks, the code completion, refactoring tools and cvs support really improve my productivity. It's a tad slow though, even though some parts are native code (the graphics widgets, SWT). I have to use Delphi for my work currently and where 5 years ago I love the Delphi IDE, I know really long for something like eclipse. As to includes in C++, in Java you have import, but there is a big difference with how both of them work! I mean in C (and C++ I guess), include is _just_ a precompile thing where code gets thrown together, with all the naming clashes that can bring (hence namespaces in C++), in Java the package structure should take care of that and it's not just throwing code together. Another thing I've noticed is that most people are edging on, but not really crossing, the border between procedural (i.e., C) and object oriented programming when doing C++. For JAva I really recommend you to learn to think fully in OO, maybe even look at smalltalk to see how extreme it can get (although extreme is never good). |
|
#16
|