New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

bash 'export' command not working


Post Reply New Thread Subscribe

 
Thread Tools
msae

 
Member Since: Jun 27, 2011
Posts: 7
msae is on a distinguished road

msae is offline
Hello,

Not sure if this is the right place to put this, but here goes.

Attempting to install jdbc driver so I can connect my java programs to a mysql server.

This is what I have done:

- downloaded mysql-connector-java-5.1.16.zip file from mysql.com.
- Following instructions to install using a bash shell, I typed into my terminal:

sudo export set CLASSPATH=/path/mysql-connector-java-5.1.16-bin.jarCLASSPATH
Password:

This is the error I get:

sudo: export: command not found

export is among my commands on my machine.
I have tried various ways of typing the export command: using no 'sudo' results in nothing I think, just returns to current directory. If that means it was successful I do not no how to check. I did try to run my java program but did not connect successfully.

I am really stuck, lost, where is my 'export' command?
Any questions or advice, please help, Thanks!
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,469
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
export is a bash builtin - it's built into bash. If it doesn't work there's something wrong with bash.
You might be better off putting that command into .bashrc or .bash_profile.
To see if it worked at all type in Terminal: env
You'll get a whole list of stuff.

edit: you shouldn't need to use sudo to put something in your environment, unless it's somehow affecting all users or the system itself.
QUOTE Thanks
msae

 
Member Since: Jun 27, 2011
Posts: 7
msae is on a distinguished road

msae is offline
Thanks Cradom,

It in fact did work, it is in my list of environment variables.

So where do you think would be a good place to store my jar file? Right now it is in my 'downloads' folder.

Thanks again for the pointer!
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,469
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
Pretty much anywhere in your user folder. If you don't have one, make a folder named Apps and put it in there.
Is this a clickable app or a command line app? If command line, you need to put wherever it is in your $PATH.
QUOTE Thanks
msae

 
Member Since: Jun 27, 2011
Posts: 7
msae is on a distinguished road

msae is offline
The problem I am having now is with some java code, getting a class not found exception when trying to load the jdbc driver, I think. I don't really understand the 'Class.forName() method. Read some things on it but still not quite sticking. I posted another thread named 'jdbc driver install location?' that has the java code. The post is under 'operating systems' as well.

I think the problem is the driver files are in the wrong location but maybe it is something else. I do know that the jdbc driver package is not meant to be clickable but that is about it for my knowledge.
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,469
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
Oh, wait, it's a driver? Missed that. Probably should go in the System somewhere then, don't know where.
Some one a whole lot more knowledgeable than me should help with this.
QUOTE Thanks
msae

 
Member Since: Jun 27, 2011
Posts: 7
msae is on a distinguished road

msae is offline
No worries, thanks for your help.
QUOTE Thanks
IvanLasston

 
IvanLasston's Avatar
 
Member Since: Feb 26, 2010
Location: Rocky Mountain High, Colorado
Posts: 2,116
IvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to beholdIvanLasston is a splendid one to behold
Mac Specs: 1.8 GHz i7 MBA 11" OSX 10.8.2

IvanLasston is offline
Put it in /etc/bashrc or try sudo -E and do the export in your own environment. That being said - you could just use macports to install
sudo port search jdbc
will show you the available setups - I thought I saw jdbc
QUOTE Thanks
msae

 
Member Since: Jun 27, 2011
Posts: 7
msae is on a distinguished road

msae is offline
Okay, to anyone who wants to know, I figured out my problem. exporting to my classpath worked fine. After that, I placed a copy of the jar file and put it in:

Library/Java/Extensions

Everything works great.
I found some placed the jar file in: Library/Java/Home/lib. Didn't work for me, maybe depends on JDK version you are running or something.

Anyway, thanks for the help!
QUOTE Thanks

Post Reply New Thread Subscribe


« Any harm with Parallels and Mac OSX open at same time? | Login Script to Mount SMB Drive to Desktop »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Intuit And Apple Working To Try And Get Quicken 2007 Working On Lion OneMoreThing... Apple Rumors and Reports 2 06-17-2011 11:53 AM
Apple working on smaller, $200 contract-free iPhone to combat Android - report the8thark Apple Rumors and Reports 33 02-15-2011 09:30 AM
DSL suddenly not working on Mac, Working fine on Windows Sr-ultimate OS X - Operating System 1 02-15-2009 07:40 PM
The same keys not working after changing keyboard? thorneyvilla Apple Notebooks 0 11-19-2008 10:38 AM
keyboard stops working, only in Finder? Help! coolskierguy OS X - Operating System 0 02-25-2008 01:56 PM

All times are GMT -4. The time now is 12:42 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?