|
|
Croatia9489 Posts
You can set an Environment Variables by clicking right click on My Computer -> Properties -> Advanced.
Let me get back to you on exactly how to set up Java variables, because I did it like a year ago and kinda forgot now ^^.
EDIT: oh yeah, you need to set path to the Java executables. Under those Environment Variables, find Path variable under System Variables and click edit. Add semi colon at the end and type the path to your Java folder where the executables are. Example: If you installed your Java to "c:\Program Files\Java", then you add to the path variable ";c:\program files\java\bin" (note: I think executables are in bin folder, but you should check just to be sure)
|
|
Croatia9489 Posts
And yeah, you should install some IDE (jGrasp is pretty simple).
You only need to edit your environment variables if you're gonna compile from command prompt, but with IDE there's no need for this.
|
Kyrgyz Republic1462 Posts
On January 30 2011 08:21 Qzy wrote:Hi You should get an IDE. Like Netbeans or Eclipse - They control everything for you and makes it simple.  . From there, try an online tutorial for java? http://www.tutorialspoint.com/java/index.htm
I would not recommend jumping into an IDE straight away though. I think it is quite helpful to understand how the whole chain of Java development process works, especially things like setting up the class path. An IDE would do that for you and that's cool, but then you will have a hard time trying to run your program without one, and that makes you feel quite stupid
|
You should just use a very simple IDE like JCreator LE. This way everything can be compiled, easily checked for syntax errors and such. After that you should use Eclipse, which I find has better functionality but JCreator is very newbie friendly. Never tried Netbeans though, but its a whole package IDE.
Im not very experienced since Ive only been doing this for a year, both C++/Java. D:
edit: Try using MS-DOS then, I would probably be stumped without a IDE.
|
ok im downloading netbeans at the moment apparently it is a pretty complete package.
i will check out JCreator LE
|
NONONONO NOT NETBEANS!!!
No, just kidding, it's not bad at all, but eclipse is so nice. It's very beginner friendly: has a red x mark if your code is wrong, green check if its right, auto suggests correction etc.
I use netbeans mostly for GUI stuff, the coding environment is worse.
|
netbeans is nice but it's buggy as fuck. I still prefer it over eclipse though.
|
On January 30 2011 09:08 fanta[Rn] wrote: netbeans is nice but it's buggy as fuck. I still prefer it over eclipse though. hi fanta sup?
|
Everyone uses Eclipse, hop on the bandwagon. Haha :D
|
Hyrule19012 Posts
I actually recommend learning C# instead. Java is bloated, and is up for some hard times.
|
If you want to start by learning, check out Blue Pelican Java - its a free java textbook
|
If you choose to use an IDE (you should), use IntelliJ. IntelliJ blows Eclipse out of the water in terms of usability and integration with other tools.
I use IntelliJ at home, and IDE at work because the corporate version is ridiculously expensive.
|
On January 30 2011 08:55 Coagulation wrote: ok im downloading netbeans at the moment apparently it is a pretty complete package.
i will check out JCreator LE
Nooooooooooooooo!!!!
If you are starting, do not use an IDE. You have to learn how to set things up.
Besides that, if you are just gonna code simple programs, there is no need to fire up a whole IDE and start coding when you could just open a terminal and notepad.
When you have the need to develop a GUI that demand too much repetitive coding, then use an IDE.
|
Don't listen to these guys saying not to use an ide. If you've never programmed before, your goal isn't to become a ninja yet, you just want to learn the basics... There can be done arcane wizardry required to compile and run programs for any language, and it's better to have a solid understanding of programming fundamentals before you start trying to figure that out too...
|
On January 30 2011 09:52 fabiano wrote:Show nested quote +On January 30 2011 08:55 Coagulation wrote: ok im downloading netbeans at the moment apparently it is a pretty complete package.
i will check out JCreator LE
Nooooooooooooooo!!!! If you are starting, do not use an IDE. You have to learn how to set things up. Besides that, if you are just gonna code simple programs, there is no need to fire up a whole IDE and start coding when you could just open a terminal and notepad.
If he is learning java for education he should learn the basics, yes. If he is learning java to learn an additional language or just start to learn programing, there is no need to code in notepad and compile it via command line.
An IDE is a good tool to keep track on what is working and what is not. Not to mention step by step debugging which made learning to program a lot easier. Why should he sacrifice this for some command line skills he won't need if he will never implement complex systems?
|
The error tracking is a good point, but here are my reasons for not using an IDE:
1. He would be using a bazooka to kill a fly (complete netbeans package will install so much stuff that he probably will never use) 2. Opening a terminal+notepad is way faster than Netbeans 3. He has everything he needs installed (the JDK), just need to set the Path, which was explained step-by-step above
|
On January 30 2011 11:00 fabiano wrote: 1. He would be using a bazooka to kill a fly (complete netbeans package will install so much stuff that he probably will never use) Is that really an issue? Most computers can handle it, right? So what's bad about installing much stuff you'll never use?
On January 30 2011 11:00 fabiano wrote: 2. Opening a terminal+notepad is way faster than Netbeans If i read the OP correct, he cannot code yet. He WILL make plenty of mistakes some of which are hard to figure out on the command line (java compiling errors and exceptions sometimes really suck ...). A step by step debugger will save him more time than opening all those netbeans sessions will cost.
On January 30 2011 11:00 fabiano wrote: 3. He has everything he needs installed (the JDK), just need to set the Path, which was explained step-by-step above See 2. It's not about being able to code with the current setup, it's about learning efficiently.
One things why java is so easy to learn is because of it's easy to setup IDEs that let you look into how and why the program works. Not to mention that most of the IDEs are free. If it weren't for that, c# would be just as good as a first programing language.
|
Ok, go with IDE then.
Hopefully you will see how much fun programming is!
Remember that many times you will find yourself stuck at something, like with the problem with Path you posted here, but by experience I can assure you these are the times you learn the most. This was a good time to learn what classpaths are, even if still don't know how to code 
But if you are rushing to learn how to code, just go with IDE.
|
Well I'd recommend Eclipse. Messing around with classpaths and all that junk can come later when it's important and you have a reason to. If you want to jump into coding and learning OOP then get an IDE and go mad. I included a quick tutorial that should get you started:
I first learned java on Eclipse and still use Eclipse for work today. It is very easy for a beginner to work with because you can ignore all the advanced functions and just use what you need.
Okay first you obviously want to install eclipse and the JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Download JDK) http://www.eclipse.org/downloads/ (Eclipse IDE for Java Developers)
When you first start it up you'll see something like this and possibly something asking about a workspace location: + Show Spoiler +
Now I remember when I first started out I just said to myself what is this shit. The trick is just to close it and get to the workbench. If you are asked to specify a workspace just pick a sensible location. The default it suggests is probably fine. A workspace is a bunch of folders that contain things like: - Eclipse settings/preferences - Your projects
For example if you were doing work at school and at home I'd have my workspace on a USB drive and point eclipse to that workspace.
Onto the next screen.
Your workbench should look somewhat like this. Your package explorer on the left, editor in the center and console down the bottom.
If you want to write some code the first thing is making a new project. Right click on some blank space in your package explorer and go to new > java project. + Show Spoiler +
Fill out the project name and hit finish. You can ignore the rest of the advanced options. + Show Spoiler +
Now we want to make a class. It's important to always make sure your classes start with a CapitalLetterLikeThis and that the class name share the name of the CapitalLetterLikeThis.java file.
Right click on the src folder > new > class. + Show Spoiler +
Name the class HelloWorld and hit finish. You could also optionally tick the auto main method generation but that's just lazy  + Show Spoiler +
Here you can type your code into the editor. I just did a simple "hello world". Once you are done and providing there are no syntax errors you can hit the "play" button to run your application. The output will appear in the lower part of your screen in the "console" tab.
If you manage to create a program that goes into an infinite loop you can hit the stop button to terminate it. + Show Spoiler +
That's pretty much it for my simple Eclipse tutorial 
I'll give you one last tip though. Since you'll be writing a lot of console based applications in the beginning you'll have to write System.out.println a lot and as you can guess this is pretty annoying. Luckily Eclipse is awesome. You can just write the shorthand version "sysout", hit CTRL+Space and Eclipse will do the rest.
![[image loading]](http://i.imgur.com/UTG2R.png)
Hope this helps. I know other people suggest Netbeans but I've never liked it. I found Eclipse is easier to get started with and more flexible in the long run.
Edit: spoilered big images cause my post ended up way bigger than I expected D:
|
wow thanks for the step by step vek i will download eclipse and see if its any more user friendly.
so far i have made a calculator in netbeans using a guide.
|
On January 30 2011 13:49 Coagulation wrote: wow thanks for the step by step vek i will download eclipse and see if its any more user friendly.
so far i have made a calculator innetbeans using a guide. Hah like a full blown calculator with a gui? That's pretty advanced for having just started coding
|
On January 30 2011 13:49 Coagulation wrote: wow thanks for the step by step vek i will download eclipse and see if its any more user friendly.
so far i have made a calculator in netbeans using a guide.
Awesome, if I wouldve written something like that for practice... Probably be a million lines of code, still trying to find my "style". Pretty much still lack experience in efficiently optimizing code and maybe I should just focus on one language instead of trying to learn multiple like some wannabe brainiac.
Though its fun once you get into it but sometimes I go on a brief hiatus, I havent practiced the past 2 weeks after going on a 1 month winter break.
|
If you have never done any sort of programming before I'd recommend following this free Python book/tutorial rather than using Java:
http://learnpythonthehardway.org/index
edit: Sounds like you're off to an ok start though, if you can make a calculator already (and understand what you're doing) then the above book may be too simple .
|
|
On January 30 2011 17:28 gravity wrote:If you have never done any sort of programming before I'd recommend following this free Python book/tutorial rather than using Java: http://learnpythonthehardway.org/indexedit: Sounds like you're off to an ok start though, if you can make a calculator already (and understand what you're doing) then the above book may be too simple  .
Thanks for the link, was looking for some nice tutorials for total (like last place bronze league) noobs in programming like me.
|
On January 30 2011 19:16 Inori wrote:Show nested quote +On January 30 2011 08:12 Coagulation wrote: I have been wanting to get into learning coding (simple stuff )and from what i understand java is a good start point.
??????? Out of all the languages out there for "simple stuff", you choose Java? What, Ruby, Python, PHP and etc were too hard for you? On a serious note, after Oracle bought Sun, I wouldn't recommend anyone learning Java, simple stuff or not. It will be going downhill, just like MySQL is already. Trust me.
Im finding more and more people telling me this, too bad my uni decided to do Java instead of the usual C++ or Python this year... I have to continue and complete this last course before I move on. Though Im trying to teach myself C++.
|
Dont chose Java. Please. You will thank me later. Go C++/C# or Python. I'd rather have learned even Bash than fucking Java. If you must, go for Eclipse for coding.
|
Java is not so bad, makes transition to other languages also quite easy.
C# is probably better though
|
Yeah I'm no expert or anything, but like fanta said, I learned Java first and it was pretty easy learning other languages after wards.
I'm curious (as someone who wants to learn more about the field) why Java gets so much hate?
|
Because Oracle bought Sun.
Once you learn the OO paradigm, no matter the language you learnt first, its going to be an easy transition to any other OO language.
Also, Java isn't going downhill so fast. The Android platform is growing strong, Java is still a good language to have in your curriculum.
|
On January 31 2011 00:01 fabiano wrote: Because Oracle bought Sun.
Once you learn the OO paradigm, no matter the language you learnt first, its going to be an easy transition to any other OO language.
Also, Java isn't going downhill so fast. The Android platform is growing strong, Java is still a good language to have in your curriculum.
Even though oracle is trying to screw us all there are still open source alternatives like open JDK. As long as oracle's tactics don't divide java into a bunch of different flavors everything will be okay.
And I totally agree -- java isn't going anywhere - but I might be biased because my future depends on it . . .
|
I think you should learn Python or Scheme instead. Python is easy to learn and very powerful, more so than Java, also object-oriented if that's what you're aiming for. Scheme completely lacks syntax and so you can focus on actually learning about programming instead of bothering yourself with learning syntax rules and is very powerful as well. Java is way too verbose and its power comes from the huge number of libraries and tools like Eclipse or Netbeans and that in a way teaches you bad habits if it's your first language.
The best book for Scheme I think is The little schemer, SICP is probably better for depth but a little too difficult and heavy to start in my opinion (it's a weedout introductory course by MIT). It's easier to find a python book, surf the web or go to your local library and look for o'reilly introductory Python books.
Here's an article that may be of interest to you: http://www.catb.org/~esr/faqs/hacker-howto.html
You should stay away from c/c++ at the moment, they're just not powerful enough and they only serve specific purposes. Python and scheme(lisp) are much more general purpose.
|
|
|
|
|
|