Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 22, 2005, 05:08 PM   #1
juhani
macrumors member
 
Join Date: Nov 2004
Location: All over the place (UK at this moment)
Send a message via MSN to juhani
Issues with Java

Ok, I'm just starting out with Java and even borrowed some books from the library and stuff and everything was all clear since I actually had to write the 'Hello Java' program. Namely, these books tell me that i should write the well-known 'hello java' script to some kind of text editor, then compile it, then run it and voila - enjoy. So I started to look what's inside my OS X and found developer tools. I intalled it, tried several programs to compile the stuff, failed and then found XCode. I chose new file, java (or something) and was pretty happy 'cause at last i could write the freakin' script. But when i finished, the 'compile' command was as inactive as it is possible to be! So why is it so ? Anyway I gave up, ran help and found out that new project would be much better choice to begin with a new program. But when i did it (chose a new project from the file menu) it showed me several options like Swing and many, many more that I can't recall at the moment. So what are they??? Which one should I choose and why ? And now the most disturbing matter. When i finally chose something that made absolutely no sense to me as none of those borrowed books had covered them (yet?), the computer created several files which already had scripts inside?!? Plus, there were many folders loaded with stuff inside that i did't expect to discover in the first place??? So here's my simple question: What the hell is going on??? Please help me, 'cause I'm really tired being such an ignorant fool and I don't want to ask those stupid questions any more.

Thanks in advance,
Juhani

PS. Maybe the problem is also with the books which (perhaps) expect me to use that freakin' Windows and don't tell me the stuff i need to know when using Mac. Isn't there any good Java book for beginners that also covers OS X? It was really strange and stupid that the library at Univerity of Glasgow didn't comprise almost any book related with Macs.
juhani is offline   0 Reply With Quote
Old Feb 22, 2005, 05:50 PM   #2
therevolution
macrumors 6502
 
Join Date: May 2003
Those books probably talk about compiling and running Java programs like this: (assuming you have a program saved to a file named HelloWorld.java)

Code:
javac HelloWorld.java
java HelloWorld
Is this similar to what your books say? If so, you can do this in OS X with Terminal. Go to /Applications/Utilities and open the "Terminal" program. Those commands will work there. You will need a basic understanding of how to operate in a UNIX environment. Many tutorials exist on the web; try Googling "unix tutorial" if you need this.

Last edited by therevolution; Feb 22, 2005 at 05:53 PM.
therevolution is offline   0 Reply With Quote
Old Feb 25, 2005, 01:18 PM   #3
juhani
Thread Starter
macrumors member
 
Join Date: Nov 2004
Location: All over the place (UK at this moment)
Send a message via MSN to juhani
Right.. thanks for your many helpful replies indeed! At least I tried ... Anyway I'm back on the track now and not so much at sea any more. I got my 'Hello Java' working too ...
juhani is offline   0 Reply With Quote
Old Feb 25, 2005, 02:04 PM   #4
therevolution
macrumors 6502
 
Join Date: May 2003
I tried my best. Your post was rambling almost to the point of incoherency.

Next time, keep your question short and to the point. Try spacing it out a little more to make it less intimidating to read.

Also, when programming, you're often faced with "why doesn't this work" situations. Showing a little more initiative to figure it out on your own and telling us the results, rather than "OMG why isn't this working?!!!111," would probably have earned you more responses as well.
therevolution is offline   0 Reply With Quote
Old Feb 28, 2005, 12:19 PM   #5
juhani
Thread Starter
macrumors member
 
Join Date: Nov 2004
Location: All over the place (UK at this moment)
Send a message via MSN to juhani
yeah..

i guess you're right...
juhani is offline   0 Reply With Quote
Old Feb 28, 2005, 02:40 PM   #6
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Quote:
Originally Posted by juhani
Please help me, 'cause I'm really tired being such an ignorant fool and I don't want to ask those stupid questions any more.
Perhaps a class or college course might help.

As for a book, look for books with command line examples to start. This will help you understand the ideas of compiling into bytecode (javac) and then running it (java). Assuming you have the JDK installed on your mac, these will be available using Terminal.

Or if you want the "easy" way out, download and install Eclipse and use that to run programs. It may be above your head (right now), however.
jeremy.king is offline   0 Reply With Quote
Old Feb 28, 2005, 03:09 PM   #7
kettle
macrumors 65816
 
kettle's Avatar
 
Join Date: May 2002
Location: England, Great Britain (Airstrip One)
Send a message via AIM to kettle
Isn't Java going to get strangled to death quite soon?
__________________
Well gentlemen, a great deal of money has been invested in this project...
...and we can't allow it to fail.
File Under - METAL
kettle is offline   0 Reply With Quote
Old Feb 28, 2005, 03:09 PM   #8
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Quote:
Originally Posted by kettle
Isn't Java going to get strangled to death quite soon?
By?

Its more popular than one might think - especially in embedded systems and JVM on a chip...
jeremy.king is offline   0 Reply With Quote
Old Feb 28, 2005, 05:21 PM   #9
kettle
macrumors 65816
 
kettle's Avatar
 
Join Date: May 2002
Location: England, Great Britain (Airstrip One)
Send a message via AIM to kettle
Quote:
Originally Posted by kingjr3
By?

Its more popular than one might think - especially in embedded systems and JVM on a chip...
yeah, I wasn't meaning its usefulness, more the tit for tat Microsoft v Sun trying to trip each other up, generally making it a headache to use cross platform.

That was the last I was reading about it, some sort of legal crud messing things up for people.
__________________
Well gentlemen, a great deal of money has been invested in this project...
...and we can't allow it to fail.
File Under - METAL
kettle is offline   0 Reply With Quote
Old Feb 28, 2005, 09:09 PM   #10
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Quote:
Originally Posted by kettle
yeah, I wasn't meaning its usefulness, more the tit for tat Microsoft v Sun trying to trip each other up, generally making it a headache to use cross platform.

That was the last I was reading about it, some sort of legal crud messing things up for people.
We'll I'll assure you, disputes aside (which have been ongoing for years), Java isn't going anywhere. Sun will tank before Java, since it has quite the following and Big Blue waiting to gobble it up...That is, unless Ruby takes off...
jeremy.king is offline   0 Reply With Quote
Old Mar 3, 2005, 11:43 AM   #11
juhani
Thread Starter
macrumors member
 
Join Date: Nov 2004
Location: All over the place (UK at this moment)
Send a message via MSN to juhani
Quote:
Originally Posted by kingjr3
Perhaps a class or college course might help.

As for a book, look for books with command line examples to start. This will help you understand the ideas of compiling into bytecode (javac) and then running it (java). Assuming you have the JDK installed on your mac, these will be available using Terminal.

Or if you want the "easy" way out, download and install Eclipse and use that to run programs. It may be above your head (right now), however.
Well actually I am planning to go to university next year to study IT and although they don't expect me to know Java or any other programming language I'm still very eager to get started by myself.

And I don't want an easy way out! I'd like to understand the core of the programming and for example why am I doing something when I'm doing it and so on. Not just enter the code and press buttons. So I think I'm going to work with Terminal for a while before taking up XCode or something else. It's just.. when, for example, I enter open Hello.java then the system still opens the file in XCode. Isn't it possible to do everything in Terminal?
juhani is offline   0 Reply With Quote
Old Mar 3, 2005, 12:05 PM   #12
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
An uber geek might say use vi to edit your files.

I would suggest you change the application associated with .java files. You can do this in the Get Info window on the file.

SubEthaEdit is a good text editor amongst others.
jeremy.king is offline   0 Reply With Quote
Old Mar 4, 2005, 02:04 PM   #13
juhani
Thread Starter
macrumors member
 
Join Date: Nov 2004
Location: All over the place (UK at this moment)
Send a message via MSN to juhani
Quote:
Originally Posted by kingjr3
An uber geek might say use vi to edit your files.
All right... although i don't know what the 'vi' is.. but i'm going to find out!
juhani is offline   0 Reply With Quote
Old Mar 17, 2005, 11:38 PM   #14
mwpeters8182
macrumors 6502
 
Join Date: Apr 2003
Location: Boston, MA
I wouldn't suggest VI for someone new to the programming game - unless you're the type that does everything in the terminal. Go for textwrangler, from the same folks who make BBEdit. It does syntax highlighting, and isn't a resource hog.

<MP>
__________________
2.0 GHz Aluminum MacBook
iPhone 3G
mwpeters8182 is offline   0 Reply With Quote
Old Mar 18, 2005, 06:31 AM   #15
netytan
macrumors 6502
 
Join Date: May 2004
Quote:
Originally Posted by kingjr3
We'll I'll assure you, disputes aside (which have been ongoing for years), Java isn't going anywhere. Sun will tank before Java, since it has quite the following and Big Blue waiting to gobble it up...That is, unless Ruby takes off...
I agree that Java isn't going anywhere just yet but it is loosing a lot of ground to M$.NET.

Personally I try to stay away from anything M$ has touched but since C# is becoming the first language taught in education it's getting harder to avoid.

Luckily there is an Open source alternative: Mono. But I'm not sure about the state of play when it comes to making Cocoa applications with C#. I'm sure there's a way.

Mark.
__________________
12" G4 IBook (1GHz) named Darwin: 60GB HardDrive, BlueTooth, Airport Extreme coming soon?
netytan is offline   0 Reply With Quote
Old Mar 18, 2005, 07:15 AM   #16
kettle
macrumors 65816
 
kettle's Avatar
 
Join Date: May 2002
Location: England, Great Britain (Airstrip One)
Send a message via AIM to kettle
Is Java going to become open source?
__________________
Well gentlemen, a great deal of money has been invested in this project...
...and we can't allow it to fail.
File Under - METAL
kettle is offline   0 Reply With Quote
Old Mar 18, 2005, 07:50 AM   #17
DavidLeblond
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
Quote:
Originally Posted by kingjr3
Perhaps a class or college course might help.

As for a book, look for books with command line examples to start. This will help you understand the ideas of compiling into bytecode (javac) and then running it (java). Assuming you have the JDK installed on your mac, these will be available using Terminal.

Or if you want the "easy" way out, download and install Eclipse and use that to run programs. It may be above your head (right now), however.
I gotta support his plug for Eclipse. That is the only tool I ever use to do my Java coding in. I don't see it as being the "easy way out" though. When you get further along in your programming, you're going to want a debugger.
__________________
iOS Developer
DavidLeblond is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
activating Matlab 7.6 on OSX 10.9 and Java issues msvadi OS X Mavericks (10.9) 4 Nov 16, 2013 06:20 PM
Issues using Java chatrooms on my Mac ausguitarist Mac Basics and Help 0 Oct 28, 2013 02:51 AM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 09:13 AM
Oracle Releases Java 7 Update 13 to Address Security Issues, Reenable Web Plug-in on OS X MacRumors MacRumors.com News Discussion 134 Feb 17, 2013 12:40 PM
2012 13 Air 10.8.1 Java issues BigB82 OS X 10.8 Mountain Lion 2 Jan 10, 2013 03:41 AM

Forum Jump

All times are GMT -5. The time now is 06:10 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC