 |
 |
New to xcode
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2005
Status:
Offline
|
|
I installed xcode to write java apps, but when i want to compile them, the build menu is all grayed out. Any suggestions?
|
|
PB12 / 1.5 / 80 / 1.25 / SD
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by warra
I installed xcode to write java apps, but when i want to compile them, the build menu is all grayed out. Any suggestions?
You realize that Xcode can only compile projects, not individual files, right? (That is, even if there's only one file you want to compile, it has to be in a project, because that is where Xcode stores its build settings.)
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2005
Status:
Offline
|
|
no, i didn't know that. How would I go about just compiling one file? Told you I was new to xcode...
|
|
PB12 / 1.5 / 80 / 1.25 / SD
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2005
Location: Vancouver, BC
Status:
Offline
|
|
You might be able to just use the command-line Java compiler -- javac.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: May 2005
Location: Toronto, ON
Status:
Offline
|
|
I'm not really sure on any of this b/c although I have xcode installed, I haven't had the time to sit down and learn to use it.
But you might find more help in the developer's center forum
http://forums.macnn.com/developer-center/
hope that at least gives you a starting point. Good luck.
|
|
MacBook Pro | 2.16 ghz core2duo | 2gb ram | superdrive | airport extreme
iBook G4 | 1.2ghz | 768mb ram | combodrive | airport extreme
iPhone 3GS | 32 GB | Jailbreak, or no Jailbreak
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status:
Offline
|
|
to compile one file, you will need to create a project in xcode and then have your file listed there to be built.
tomchu has the right idea if you would rather not create a project: write up the code in xcode (for the nice color coding and help strings) and then use javac from terminal (not sure what all the arguments would be, but it will create the files for you) for the compile/build....and checking the developer's forum is also always a good thing too.
|
|
some people are like slinkys: they don't do much, but are fun to push down stairs.
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
Like people are saying, either just use [font=Courier New]javac[/font] from the command line, or make a project in Xcode. The proper project template is "Java tool" or something like that.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2005
Status:
Offline
|
|
I tried using Java Tool, then created a new file (a very simple java program), but it said it it failed whil trying to build.
|
|
PB12 / 1.5 / 80 / 1.25 / SD
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
Don't create a new file. Edit the projectname.java file that is automatically created for you.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2004
Location: Downtown Austin, TX
Status:
Offline
|
|
If you're just making simple (less than 10 files) Java programs, forget XCode. I'd download jEdit or TextWrangler and use one of those to edit your files and then open up a Terminal and type:
"javac YourJavaFile.java"
to compile, and then do
"java YourJavaFile"
to run.
javac will generate your .class file, but when you specify the class file to java command you have to leave off the .class extension, otherwise you'll get a class not found error.
For example, if your source file is named TheAwesome.java, you would type
"javac TheAwesome.java"
to compile, and then
"java TheAwesome"
to run it.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2005
Status:
Offline
|
|
excellent, thanks everyone.
|
|
PB12 / 1.5 / 80 / 1.25 / SD
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|