Java Programming in Xcode

First I want to apologize for some that they thing this question is a repeat.
However I do need seriously help with using Xcode tool for programming. Moving on, I have made many searches online how do you use Xcode Tool for Java. As you may all already asked this question before and I have marked solved, but it was not. One guy suggest that I should use netbeans, Eclipse, and etc. however I do not want to use any other I.D.E.'s to do some programming at all.

Alright, I'm in college and I am taking Advanced Java. It is all going well, but I want to learn it on Xcode, but I do not know how to. I need some guidance how to use it properly and run application that I developed in Java Language. I already have went to: File ====> New Project ====> Java ====> Java tool.

Then I go to src folder and edit out the Java File inside that folder to build my Java file. Okay, after that I type my codes in and i click Build and go. Nothing happens at all. It just says program executed and blah blah blah.

So I know there is someone out there who already know his/her way around xcode and could guide me through this!!!

Oh! I use xcode 3.1.2(If that helps!)

Thank you to all(In Advance)
-Raja CPatel

iMac, Mac OS X (10.4.11), iDunno

Posted on Aug 30, 2009 9:00 PM

Reply
18 replies

Aug 30, 2009 9:39 PM in response to Raja CPatel

Why did you choose java tool? Xcode apparently doesn't have a java template available for Snow Leopard yet, so I can't see exactly what you did.

Is the "java tool" a supplement to something else?

Are you trying to make an application instead? Try out the other templates under java (if any of what I just said makes sense) 🙂

Hope that helps : /

I myself have only used the "Application" template (I think thats what its called...stupid Xcode in SL)

Aug 30, 2009 10:08 PM in response to JStock23

Uhh Guys! I should have been little bit more specific about which O.S. I was running! I am currently using Mac OS X 10.5 Leopard. I do apologize if you have thought that I was using Mac OS X 10.6 Snow Leopard. However I have no clue if I am using Java SL or what! I do believe that Xcode tools do install all the stuff it needs to, so it can run. I know how to use it for C++.

By the way, I did look up many post people saying that go to SRC directory and write your programs in that directory. That's the reason I have mentioned SRC directory.

Aug 30, 2009 10:18 PM in response to Raja CPatel

Ya, my mistake, I read the signature of the wrong person.

So even if you create a blank project It won't work either? Is it supposed to create a window or simply output something to the system?

If it puts out text to the system then go to Run > Console, then run it and see if anything gets outputted to there.

Also, in the top left of Xcode, there should be a menu bar that says "Cur. OS <etc>" change that to "Mac OSX 10.4" and see if that helps. (I'm not sure if that works in the version of Xcode you have)

Otherwise, try a system update and make sure you have the most up to date version of Java.

Aug 30, 2009 10:27 PM in response to Raja CPatel

Raja CPatel wrote:
Okay, you have to guide me to that path mate!
I'm kinda lost and confused!


Was talking to the other person using SL, not you...

Raja CPatel wrote:
i've tried all the template too and when it comes to build and go, nothing pops of the screen mate


When selecting a template, choose:
• Java Applet

Make no changes except to 'Release' - top left pull-down in the main Xcode window. Click 'Build & Go'.

The 'jar' file will be in the project folder/dist folder...

You can control-click on the target name on the left and choose 'reveal in finder'...

A new window should open on your computer that says 'Hello World'.

If this doesn't occur, your JAVA install is most likely borked. If you're looking to upgrade, I recommend to upgrade to SL if possible.

Please update your profile info to show the OS you are currently using as well, thanks.

Aug 30, 2009 10:34 PM in response to K T

To K T:

I did the JNI library template, but that template creates a program that already has a function and isn't suitable to be used as a starting point for a new application.

Is there simply a template that creates a simple project with a main window, a preference frame, and an about window like there was in Leopard? (I think I remember that to get this functionality in Leopard I had to install from a folder of optional frameworks. It was like an optional "Tool" that came with the Xcode download that you could choose to install)

Thanks for your trouble 🙂

Aug 30, 2009 10:40 PM in response to JStock23

JStock23 wrote:
To K T:

I did the JNI library template, but that template creates a program that already has a function and isn't suitable to be used as a starting point for a new application.



Run a previous Xcode version, say 3.1.2...use the JAVA application template there to build a new project/app. Locate that project with Xcode 3.2 and open.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Java Programming in Xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.