Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Here's a few places to check:

~/$ProjectName
/Users/$HomeDir/$ProjectName (same dir as above, just the full structure)
/Developer/$ProjectName

Within XCode, you can press Apple+I and it will show where its at.
e.g "Path: /Users/$HomeDir/Projects/$ProjectName"
 
Here's a few places to check:

~/$ProjectName
/Users/$HomeDir/$ProjectName (same dir as above, just the full structure)
/Developer/$ProjectName

Within XCode, you can press Apple+I and it will show where its at.
e.g "Path: /Users/$HomeDir/Projects/$ProjectName"

thanks, but i mean inside xcode. i thought that it would be there, but it's not. i only see a .xml file, and some folders, but no .java file

did i do something wrong? i just chose a Java application when i created a new project
 
No problem... you've created the project, but no file.

When you're looking at the project window, right click on the project (should be the top thing under "Groups and Files" on the left) and select Add->New File...->Pure Java->Java Class.
 
No problem... you've created the project, but no file.

When you're looking at the project window, right click on the project (should be the top thing under "Groups and Files" on the left) and select Add->New File...->Pure Java->Java Class.

oh ok. i thought it was something like that. i'm used to other languages, where xcode makes though files automatically
 
oh ok. i thought it was something like that. i'm used to other languages, where xcode makes though files automatically
The thing is, there's no automatic file it could make, unless you'd be willing to assume that a "MySampleProject" project would always want "MySampleProject.java", which is possibly useful for school projects, but which a professional would rarely want.
 
The thing is, there's no automatic file it could make, unless you'd be willing to assume that a "MySampleProject" project would always want "MySampleProject.java", which is possibly useful for school projects, but which a professional would rarely want.

oh ok. well, java is still very new to me (first day of class). hopefully i'll learn more very soon

thanks :)
 
ok, so i'm having a little trouble. i made a new project - a java application. did i want java applet?

i added the java class file to it. but all i want is a simple command line program. what i have doesn't print anything.
 
No, you didn't want a java applet, unless you will be embedding it into a web page.

You probably wanted a Java Tool. With a Tool, it does build a .java file template for you with a "Hello World!" println.

Todd
 
No, you didn't want a java applet, unless you will be embedding it into a web page.

You probably wanted a Java Tool. With a Tool, it does build a .java file template for you with a "Hello World!" println.

Todd

thanks, i'll try that next time.

i ended up just using terminal to compile and run the program. i made a 100! :D
 
WOO-HOO!!! Good for you. What was the assignment?

thanks. it wasn't hard. 3 very simple programs:

1. make a program that flips a coin 10 times and displays heads or tails
2. change program #1 to ask the user how many times to flip the coin
3. put 100 random numbers in an array. print the sum of the square roots of the values.

so it was pretty easy. but i know they'll get harder
 
so for my class, we will be creating java servlets. in windows, they use tomcat. what do i use for mac and with xcode? or can i do this?
 
so for my class, we will be creating java servlets. in windows, they use tomcat. what do i use for mac and with xcode? or can i do this?

Tomcat works on Mac OS also. When I worked with JSP I used used a text editor like TextWrangler and the terminal.
 
twoodcc, thanks for demonstrating why an IDE may not make sense when getting started with Java and congrats on your 100. If you really wanted to try an IDE again later that shouldn't get in the way, do check out Netbeans BlueJ edition.

Also, you can use a variety of app servers such as tomcat, jetty, glassfish and others...All work just as well on the Mac. I'd suggest tomcat since that's what the instructor is using.
 
twoodcc, thanks for demonstrating why an IDE may not make sense when getting started with Java

Just because he doesn't understand the concept of an IDE before it ever being explained to him doesn't make your statement correct. Spend 5 minutes, explain the differences of these tools, and he'll be off on his merry way with more knowledge.
 
Tomcat works on Mac OS also. When I worked with JSP I used used a text editor like TextWrangler and the terminal.

thanks, i'm working on installing tomcat now. a little more complex than i thought

twoodcc, thanks for demonstrating why an IDE may not make sense when getting started with Java and congrats on your 100. If you really wanted to try an IDE again later that shouldn't get in the way, do check out Netbeans BlueJ edition.

Also, you can use a variety of app servers such as tomcat, jetty, glassfish and others...All work just as well on the Mac. I'd suggest tomcat since that's what the instructor is using.

thanks, i actually made 100 last week, and the instructor asked me to present it to the class! again, it was still just a simple program.

yeah, i'll go with tomcat since my team members have that as well. i also have to think about what type of database to use. mysql?
 
Again, lots of choice here. I suggest you use what your instructor encourages. You can use Mysql no problem.

well, he said you could any you wanted to, but recommended access. which i can't do i mac os x, right?

also, i'm having trouble installing tomcat. i was trying to go by apple's pdf, but for some reason it didn't work
 
Java, Mac OS X, and IDEs

Congrats on the good score. I'm taking a couple of Java classes now myself (just finishing up the first one).

A few things to note when developing Java apps on Mac OS X.

1) XCode is nice, but Eclipse is a much better Java IDE (although I feel that Xcode is a much better IDE overall). Especially for a newbie like you and me, Eclipse is always compiling and evaluating code, and it will let you know immediately when you've made a mistake, which is much better than writing 100 lines of code and finding your mistake after your run your app. TextMate makes a pretty nice code editor as well, but still, you don't get the instant code checking that Eclipse provides.

2) There are plenty of servlet engines for Mac OS X. Tomcat is the most popular. The installation is pretty painless. Download it, unzip it, place it in your apps folder, and then run the catalina.sh start script in the terminal. Boom. Check localhost:8080, and you should see the Tomcat splash screen. There is also JBoss, and now Glassfish as well.

3) Get comfortable with the command line. Compiling from the command line is easy once you know what you are doing. Most Java tools are written with UNIX/Linux in mind, so using the terminal will be a huge help to you down the road.

Good luck!
 
Congrats on the good score. I'm taking a couple of Java classes now myself (just finishing up the first one).

A few things to note when developing Java apps on Mac OS X.

1) XCode is nice, but Eclipse is a much better Java IDE (although I feel that Xcode is a much better IDE overall). Especially for a newbie like you and me, Eclipse is always compiling and evaluating code, and it will let you know immediately when you've made a mistake, which is much better than writing 100 lines of code and finding your mistake after your run your app. TextMate makes a pretty nice code editor as well, but still, you don't get the instant code checking that Eclipse provides.

2) There are plenty of servlet engines for Mac OS X. Tomcat is the most popular. The installation is pretty painless. Download it, unzip it, place it in your apps folder, and then run the catalina.sh start script in the terminal. Boom. Check localhost:8080, and you should see the Tomcat splash screen. There is also JBoss, and now Glassfish as well.

3) Get comfortable with the command line. Compiling from the command line is easy once you know what you are doing. Most Java tools are written with UNIX/Linux in mind, so using the terminal will be a huge help to you down the road.

Good luck!

thanks for the nice post.

where can i download that tomcat? i did download one version, but i had to compile it myself somehow, and i couldn't do it right
 
thanks. how do i "set a env variable"?

First try to start tomcat without doing that. If it launches, you won't need to. If it complains that you should set JAVA_HOME, in terminal
Code:
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Home

You can also add the above command to your .bashrc file located in your home folder. If you don't have that file, you can create it.
 
First try to start tomcat without doing that. If it launches, you won't need to. If it complains that you should set JAVA_HOME, in terminal
Code:
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Home

You can also add the above command to your .bashrc file located in your home folder. If you don't have that file, you can create it.

well i'm still confused. i downloaded the zip, and unzipped it. now i have a folder with files in it, but nothing to launch/start tomcat (that i see).

i tried your command in terminal, but it said "setenv: command not found"

sorry i'm new to the command line
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.