Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 23, 2009, 08:17 PM   #1
frustrated007
macrumors newbie
 
Join Date: Oct 2009
JAva templates in xcode 3.2

I am confused. From what I've read here and elsewhere, most of the project templates that were in xcode 2 are not in xcode 3. Still, you can use the Organizer to create some java applications, but you don't get an xcode project file -or do you get one and I just didn't find how?

The story is, I just got a new MacBookPro (yeah!) and I am importing all my stuff from my old MacBookPro. In particular I have a console Java application created in XCode 2; the project opens fine in Xcode 3 but it won't build. So I put my code in the Organizer generated java app and it works fine, but I would still like to get it the old way with the project file...
frustrated007 is offline   0 Reply With Quote
Old Oct 23, 2009, 09:06 PM   #2
Watabou
macrumors 68020
 
Watabou's Avatar
 
Join Date: Feb 2008
Location: United States
My problem is similar. Do you get "build xml can't be found" error?
__________________
Haswell 15" rMBP, 2.3GHz, 16GB, 512GB SSD, 750M :: OS X Yosemite DP 6
iPhone 5
Early 2008 MBP, iPhone 3GS (retired)
Watabou is offline   0 Reply With Quote
Old Oct 24, 2009, 08:11 AM   #3
SRossi
macrumors regular
 
Join Date: May 2009
Location: Glasgow, Scotland
Don't know if this will be help but found this

Stephen
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;
SRossi is offline   0 Reply With Quote
Old Oct 25, 2009, 01:58 PM   #4
frustrated007
Thread Starter
macrumors newbie
 
Join Date: Oct 2009
Thanks Stephen, that sort of confirms what I found.
All the java stuff is gone in xcode 3.2 and that's odd as in the help of this same Xcode 3.2, Apple boasts how java is really totally integrated in the System...

Quote:
Originally Posted by Watabou View Post
My problem is similar. Do you get "build xml can't be found" error?
No I get something that starts with "Internal error occurred while creating dependency graph"
frustrated007 is offline   0 Reply With Quote
Old Oct 25, 2009, 02:57 PM   #5
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by frustrated007 View Post
In particular I have a console Java application created in XCode 2; the project opens fine in Xcode 3 but it won't build. So I put my code in the Organizer generated java app and it works fine, but I would still like to get it the old way with the project file...
Depending on which Xcode 2 project template you originally used, the old way may not be possible.

Xcode 3.2 completely removed the 'jam' build system. Jam was the builtin Xcode build system since the beginning of time. Xcode 2 introduced a "native target" build system, but that can't build Java targets.

Xcode 2 also introduced Java project templates that used the Ant build system. So if your original Xcode 2 project was jam-based, then Xcode 3.2 can't build it at all. There should be an error message that mentions jam in the build results window. It may also give the bogus recommendation to convert it to a native target.

However, if the original Xcode 2 project was Ant-based, then Xcode 3.2 should be able to build it as-is. Ant requires a "build.xml" file, which it uses to tell it what and how to build. If that file is missing or deleted for some reason, then Ant can't build. If that happens, Ant should emit the "build.xml can't be found" error message.


If the Organizer project can't be built because build.xml is missing, then you'll have to restore build.xml. The simplest way I know to do that is to create a new Organizer Project from an appropriate template, then move your existing src folder over to the new project (use Finder). Don't delete build.xml in the new project.


Java beginners may find it easier to start writing code by ignoring Xcode 3.2 and using an IDE designed for beginners: BlueJ.

http://www.bluej.org/

There are other Java dev tools available. BlueJ is just one that others I've suggested it to found useful for getting started. Some people dislike it because it's not a pro-level IDE. Those people might be better served by a professional tool, rather than one oriented toward education.
chown33 is offline   0 Reply With Quote
Old Oct 25, 2009, 04:09 PM   #6
frustrated007
Thread Starter
macrumors newbie
 
Join Date: Oct 2009
Quote:
Originally Posted by chown33 View Post
Depending on which Xcode 2 project template you originally used, the old way may not be possible.
XCode 2.4.
Quote:
Originally Posted by chown33 View Post
Xcode 3.2 completely removed the 'jam' build system. Jam was the builtin Xcode build system since the beginning of time. Xcode 2 introduced a "native target" build system, but that can't build Java targets.

Xcode 2 also introduced Java project templates that used the Ant build system. So if your original Xcode 2 project was jam-based, then Xcode 3.2 can't build it at all. There should be an error message that mentions jam in the build results window. It may also give the bogus recommendation to convert it to a native target.

However, if the original Xcode 2 project was Ant-based, then Xcode 3.2 should be able to build it as-is. Ant requires a "build.xml" file, which it uses to tell it what and how to build. If that file is missing or deleted for some reason, then Ant can't build. If that happens, Ant should emit the "build.xml can't be found" error message.
Yes my Xcode 2 project has a build.xml file and actually is built using Ant in XCode 2. I saw the project configuration has a "custom build" instruction that specifies a particular path to Ant; this path happens to be not right in the Xcode 3.2 -or perhaps it is a difference in the system (I have XCode 2 installed on 10.4). So actually I deleted this "Custom build" thing and got the error mentioned above. I'm guessing that to get it the old way I just need to figure out what Custom Build instruction should be specified but after looking around a bit I didn't find an answer.

Quote:
Originally Posted by chown33 View Post
If the Organizer project can't be built because build.xml is missing, then you'll have to restore build.xml. The simplest way I know to do that is to create a new Organizer Project from an appropriate template, then move your existing src folder over to the new project (use Finder). Don't delete build.xml in the new project.
That's what I did, it works just fine.
Quote:
Originally Posted by chown33 View Post
Java beginners may find it easier to start writing code by ignoring Xcode 3.2 and using an IDE designed for beginners: BlueJ.

http://www.bluej.org/

There are other Java dev tools available. BlueJ is just one that others I've suggested it to found useful for getting started. Some people dislike it because it's not a pro-level IDE. Those people might be better served by a professional tool, rather than one oriented toward education.
Thanks for mentioning BlueJ, I'll have a look at it.
frustrated007 is offline   0 Reply With Quote
Old Oct 26, 2009, 11:02 AM   #7
frustrated007
Thread Starter
macrumors newbie
 
Join Date: Oct 2009
Quote:
Originally Posted by frustrated007 View Post
I'm guessing that to get it the old way I just need to figure out what Custom Build instruction should be specified but after looking around a bit I didn't find an answer.
I figured it out. I specified /usr/bin/ant as the Build Tool and it works.
frustrated007 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
Xcode and java??? falconb Mac Programming 10 May 15, 2014 12:17 AM
Java 6.x security risk (?) vs Java 7.x and broken apps w/ v7.x installs? mgiamo Mac Basics and Help 1 Dec 15, 2013 03:48 PM
XCode 5 DP and Java Problem aquethys Mac Programming 0 Aug 28, 2013 09:59 PM
Simple xcode project templates mpsruo iPhone/iPad Programming 1 Jul 24, 2013 01:20 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

Forum Jump

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

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

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