Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
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 1269 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.
--Scott
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!

http://wiki.java.net/bin/view/Games/JeffFAQ
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:
http://www.macosxhints.com/article.php?story=20040715133738459&query=environment+variable

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... >.<;;

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (50 views)
2014-10-17 03:59:02

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (36 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!