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, 02:34 AM   #1
Watabou
macrumors 68020
 
Watabou's Avatar
 
Join Date: Feb 2008
Location: United States
Java in Xcode 3.2?

I just downloaded Xcode 3.2 and found out that there's no Java templates. I searched and found that I can go to the Organizer and open a Java tool project from there.But I don't know where to go from there. I tried creating a test file consisting of a simple for loop in the java tool project and tried running it but it instead runs a Hello World class. Am I doing something wrong?

I'm trying to learn java and I'm in a beggining java class in college. And please don't suggest Eclipse or any other IDE. I have my own reasons for trying out Xcode.
__________________
Haswell 15" rMBP, 2.3GHz, 16GB, 512GB SSD, 750M :: OS X Yosemite DP 5
iPhone 5
Early 2008 MBP, iPhone 3GS (retired)
Watabou is offline   0 Reply With Quote
Old Oct 23, 2009, 03:34 AM   #2
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by Watabou View Post
I tried creating a test file consisting of a simple for loop in the java tool project and tried running it but it instead runs a Hello World class. Am I doing something wrong?
Yes. You need to edit the source file in the src directory that is included in the Java Tool project. Or delete it.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is online now   0 Reply With Quote
Old Oct 23, 2009, 02:13 PM   #3
Watabou
Thread Starter
macrumors 68020
 
Watabou's Avatar
 
Join Date: Feb 2008
Location: United States
There's one java file in the src folder called Java_Tool.java. If I try to edit that or delete that file and add a file of my own in the src folder, and try to run it, it gives me an error that says build xml not found.
__________________
Haswell 15" rMBP, 2.3GHz, 16GB, 512GB SSD, 750M :: OS X Yosemite DP 5
iPhone 5
Early 2008 MBP, iPhone 3GS (retired)
Watabou is offline   0 Reply With Quote
Old Oct 25, 2009, 03:05 PM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by Watabou View Post
I tried creating a test file consisting of a simple for loop in the java tool project and tried running it but it instead runs a Hello World class. Am I doing something wrong?
If you want to run a different main class, you have to edit the Manifest file under "resources" in the Organizer project. At a minimum it should contain:

Code:
Main-Class: YourClassnameHere
If your main class is defined in a package, such as:

Code:
package my.fun.pkg;

public class MyMain
{ ...main method here... }
Then YourClassnameHere would be this fully qualified class-name: my.fun.pkg.MyMain
chown33 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
Some apps prompt to install Java 6 even when Java 7 is installed MacMan988 OS X Mavericks (10.9) 1 Apr 18, 2014 07:56 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
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 10:28 AM.

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

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