Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

droid15

macrumors newbie
Original poster
Jul 20, 2010
26
0
was following this tutorial when i came across something unusual.

Look in your home directory for .bash_profile file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don’t see a line setting the path, you can add one:
export PATH=${PATH}:/tools
You can create the .bash_profile if you haven’t already set one up on your machine.
 
I was following this tutorial when i came across something unusual... a .bash_profile I do not know what this is or where to find it also this whole step just generally confuses me.

It's a file that resided in your home folder. It's primary purpose is to define environment variables (like PATH) and aliases for the command line (aka Terminal).

Because it starts with a ".", it's a hidden file that will not show up in Finder.
 
as far as making a line setting goes... is this right? Sorry for all the questions but I have no prior expeirience to this and frankly have no idea what i am doing.


Screenshot2010-07-20at113621PM.png
 
eclipse is giving me this error whenever I try to make a new project. What does this mean?

Screenshot2010-07-21at121237AM.png
 
I posted this over in the Mac Programming forum...you might find it informative. BTW, you are trying to use Windows syntax. Highest directory in Unix is / not C:. ;)

Here's my .bash_profile and .bashrc if you want something else to play with.

I've removed some sensitive info from my bashrc, but it's mostly intact. There are a number of very handy aliases for common commands (e.g. ll for ls -l, la instead of ls -a, bye instead of exit or logout). Also, by editing the value in quotes next to PS1 you can have the prompt display whatever name you like. Be sure to un comment it before you save.

The profile offers some handy features like color coding. Put these in a plain text file and rename each one to put a "." in front of the name, and place them in your home folder. Exit the shell and restart it, and you should see the effects.

Feel free to edit them to your needs!

.bashrc

Code:
# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific aliases and functions

alias a=alias
alias la='ls -a'
alias ll='ls -lt'
alias ls='echo $PWD; ls'

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ps='ps -aux'
alias du='du -h'
alias df='df -h'
alias bye='logout'

alias ssh='ssh -Y'

# Reset the prompt
# Directory:
# PS1='[\w]$ '
# Hostname:
#PS1='whateveryouwant$ '

Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# BASH
export BASH_ENV=$HOME/.bashrc
export USERNAME=""

# Set DISPLAY
export DISPLAY=:0.0

# My Paths
export PATH=$PATH:$HOME/bin:./

# PREFIX
export PREFIX=/usr/local

# Terminal colors
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
 
So when it says "add the full path to the tools directory" I can just write this-

export PATH=$PATH:$HOME/bin:./ and then the rest of my directory.
One more thing. When I went into terminal and typed "open -t .bash_profile I just got an empty text file named .bash_profile, is it supposed to be empty like that or did I do something wrong.
 
eclipse is giving me this error whenever I try to make a new project. What does this mean?

Screenshot2010-07-21at121237AM.png

Right click on your project in the package explorer and select properties. Then click on Java Build Path. I haven't developed with android but it looks like you are missing a link to the gen folder, you can add that under the Source tab
 
So when it says "add the full path to the tools directory" I can just write this-

export PATH=$PATH:$HOME/bin:./ and then the rest of my directory.
One more thing. When I went into terminal and typed "open -t .bash_profile I just got an empty text file named .bash_profile, is it supposed to be empty like that or did I do something wrong.

From terminal, type cd so that you are in your home folder. The type the command 'ls -al' - this will display a list of all files, including hidden files. If your bash profile is there, type 'less .bash_profile' to see its contents.
 
One more thing. When I went into terminal and typed "open -t .bash_profile I just got an empty text file named .bash_profile, is it supposed to be empty like that or did I do something wrong.

The .bash_profile doesn't exist by default, so it will be empty at first.
 
I went into the properties and made sure there was a link(the folder was there) as you can see in the picture.
Screenshot2010-07-21at100707AM.png


but I am still getting this error
Screenshot2010-07-21at121237AM.png
 
This is the path to the folder I am supposed to make a path in my .bash_profile
finderway.png


and this is the bash profile itself
bash_profile.png


I am supposed to be doing this
Look in your home directory for .bash_profile file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don’t see a line setting the path, you can add one:
export PATH=${PATH}:/tools
You can create the .bash_profile if you haven’t already set one up on your machine.

but I am still getting an error that looks like this
Screenshot2010-07-21at121237AM.png


what am i doing wrong?
 
Your path looks wrong. Remove the '.' before /Users
You don't need the second export

you can type 'set' in the terminal window and it will show you all the system variables. You will be able to see the $HOME and $PATH variables to see if they are set correctly
 
From doing a quick bit of research, it looks like the gen folder contains auto generated source files. Have you generated these? You should have a src and gen folder in your package explorer window. There should be some java files under gen. If not, you will need to generate them.
 
sorry for all the questions but... how do I do generate the java files, just put random java files there or do i need some specific ones?
 
I've not worked with android so I'm probably not the best of help. I take it you are new to it as well? The java generated files are built from the xml files under res, don't know how this is done.

Have you a good tutorial there to help you set up the android dev environment within eclipse? There should be some good starter guides on the android dev site.

Under eclipse preferences, you should see an android entry. Make sure it is correctly pointing to your SDK location: /Users/Kaelan/android-sdk-mac_86

Under your project properties, if you go back to the java build path, make sure that the version of android you are using is there in the Libraries tab.

Also under the eclipse project menu, turn on build automatically if it is not already turned on and select clean and see if that helps.
 
I am now getting this warning. Last thing please interpret this warning for me.
[2010-07-21 17:46:38 - Emulator] 2010-07-21 17:46:38.766 emulator[321:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2010-07-21 17:46:54 - HelloDroid] emulator-5554 disconnected! Cancelling 'com.example.helloDroid.HelloDroid activity launch'!
 
Cool, sounds like you are making progress.

Deprecation basically means that those classes are out of date (deprecated) and that there is newer and better alternative to use. I would guess that the example application you are building was built with an older version of the android sdk (1.5 or 1.6) and you are using (2.x).

NSQuickDrawView would have been the class to use in the older version, but in the new version you should use Quartz. The application might still run, but it's not guaranteed. Deprecated classes are left there for backwards compatibility but they are no longer supported.
 
Ya I'm going to try to download an older more stable version of eclipse and see what happens.:)
 
I downgraded and it worked right off the bat this time with no errors. now my only problem is the android emulator which is not running correctly.
 
Good News I got the android emulator working correctly. Now everything is perfect except for these 2 warnings but they do not seem to affect anything
[2010-07-22 21:46:16 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-07-22 21:46:16 - HelloAndroid] Device API version is 7 (Android 2.1-update1)

and this
[2010-07-22 21:46:25 - HelloAndroid] ActivityManager: Warning: Activity not started, its current task has been brought to the front
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.