Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (223)
games submitted by our members
Games in WIP (813)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Mac OS X environment variables  (Read 1913 times)
0 Members and 1 Guest are viewing this topic.
Offline Lareon

Senior Newbie

I program for fun... Isn't that weird?!?

« Posted 2006-03-08 02:37:35 »

In my efforts to do things properly, I've removed my various .jar files from the Library/Java/Extensions directory, and am attempting to modify the CLASSPATH environment variable to work as I can only assume it should; but I've hit a few blocks...

1) 'export Classpath=[path]' does not work for more than the one time I run Terminal.  If I close and reopen, it's no longer set.  I was under the impression that environment variables were more permanent than that.

Anyhow, assuming I was wrong, I went ahead and edited (read "added) my ~/.profile to include the above 'export' line.  Now I get the environment variable right on every time...  Only problem is that 2) when I type, say "java demos.gears.Gears" from within the jogl-demos/build directory, it still won't run.  Okay, so I add the demos .jar file:

java -cp jogl-demos.jar demos.gears.Gears

This works, but for some reason, it's not reading ANYTHING that's already in my CLASSPATH environment variable to be included in the running of said java app.  If, however, I type:

java -cp jogl-demos.jar:$CLASSPATH demos.gears.Gears

...the program runs without a hitch.

So the question comese dow to -- what am I doing/interpreting wrong/incorrectly?  Is the CLASSPATH variable just a convenience thing, perhaps, and not actually intended to be a default search path for classes when starting a java program?

*sorry, I'm a tad frustrated at my own incompetence*

Any help is appreciated.
Offline Jeff

JGO Coder

Got any cats?

« Reply #1 - Posted 2006-03-08 03:20:32 »

This is as expected.

-cp or -classpath replaces the environemnt classpath with the one you sepcifiy for that run of Java

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!
Offline swpalmer

JGO Coder

Exp: 12 years

Where's the Kaboom?

« Reply #2 - Posted 2006-03-08 04:41:22 »

What shell are you using?
There are all sorts of ugly unix text files that you have to edit to have your environment set up for every shell (Terminal) you open.  It's an asinine carry-over from the 70's or earlier that to this day nobody has bothered to correct.  Even OS X that managed to add a decent GUI to unix left this part alone.  I think it's based on unix nerds wanting to feel that knowing how to do this arcane stuff makes them superior or something, so they pretend that a real UI isn't worth making...  Smiley

See also:

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Lareon

Senior Newbie

I program for fun... Isn't that weird?!?

« Reply #3 - Posted 2006-03-08 05:50:52 »

Thanks for the responses.  I'm using bash...  just the basic terminal default.  The CLASSPATH variable I set does seem to be working now when I access a jogl app from the terminal.  Interestingly, however, I can't run my projects through NetBeans anymore, though, as it doesn't seem to be asking about the DYLD_LIBRARY_PATH variable to access the .jnilib files from JOGL... >.<;;

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

cybrmynd (118 views)
2017-08-02 12:28:51

cybrmynd (141 views)
2017-08-02 12:19:43

cybrmynd (136 views)
2017-08-02 12:18:09

Sralse (152 views)
2017-07-25 17:13:48

Archive (621 views)
2017-04-27 17:45:51

buddyBro (730 views)
2017-04-05 03:38:00

CopyableCougar4 (1255 views)
2017-03-24 15:39:42

theagentd (1235 views)
2017-03-24 15:32:08

Rule (1213 views)
2017-03-19 12:43:22

Rule (1265 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!