package com.sun.j3d does not exist (Linux - Fedora Core 6)

I posted this on the 3d forums also, but it really has nothing to do with 3d but the classpath (I assume) so posting it here might work better.

Here's the thing.

I realize it's probably a classpath issue, but I don't know where to put the libraries. Compiling non-3d code works fine, which leads me to believe that running the j3d installer in the right place ought to put the libraries in the right place and let me use them. Clearly this is not the case.

Now I've tried to fiddle with the classpath, specifically I've put this into my .bash_profile:

CLASSPATH=.:$CLASSPATH:$HOME/Libraries/ext:$HOME/Libraries/i386

export CLASSPATH

And stored the jars in a libraries folder on my home directory

Odd thing: echo $CLASSPATH sends out empty, like CLASSPATH isn't even defined. How do I fix that? And if that's true, why is the regular javac working?

[903 byte] By [CoAa] at [2007-11-27 11:21:07]
# 1

Well, maybe it doesn't exist. Don't ever code against packages beginning with "com.sun", they're not part of the JDK per se, they happen to be Sun's current implementation of some features of Java, but aren't guaranteed to be there in the next release, nor will they be present at all in another vendor's implementation of the Jdk, which is probably why you can't find them

georgemca at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 2

Yeah, but it DOES exist, because I downloaded it and installed it. Furthermore, I've unjarred the j3dutils.jar (keeping the original jar, just checking) and the folders com/sun/j3d/etc. were in there. They definitely exist.

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 3

Well, they may or may not exist, or some dependency may or may not exist, or whatever. Doesn't change the fact that you shouldn't be using them. If you do, your code is essentially coupled to the exact version of the Java runtime you wrote your code under, and cannot be ported to another version of Java, another vendors JRE of any version, or possibly even another operating system

There's an article on Sun.com all about it, but I don't have the link to hand

georgemca at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 4

So your recommendation is to just not use j3d?

Can I get somebody else to help?

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 5

> So your recommendation is to just not use j3d?

>

> Can I get somebody else to help?

Sounds to me like you are using the JDK that comes with FC6. What does

java -version

give?

What does

which java

give?

sabre150a at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 6

In fact I dumped the version that came with FC6and installed the official Sun version 5.0.

java -version returns:

java version "1.5.0_12"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)

Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode)

javac -version returns:

javac -version

javac 1.5.0_12

which java returns:

/opt/jdk1.5.0_12/bin/java

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 7

So your .bash_profile is not being sourced. Source it manually in a terminal and then check the CLASSPATH.

sabre150a at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 8

Um

I don't know what you mean by "sourced" (I'm a bit new to Linux)

Can you explain what you mean by that?

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 9

Use

..bash_profile

P.S. Where did you find the information to use .bash_profile. I would expect you to set the classpath in .bashrc, .profile or, to allow all to get the same environment, in /etc/bashrc .

sabre150a at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 10

> Use

> ..bash_profile

>

> P.S. Where did you find the information to use

> .bash_profile. I would expect you to set the

> classpath in .bashrc, .profile or, to allow all to

> get the same environment, in /etc/bashrc .

I tried . .bash_profile and got this answer:

bash: CLASSPATH: command not found

And I don't recall how I decided to use .bash_profile, but .profile doesn't exist and I don't understand the syntax in .bashrc and it frightens me.

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 11

de]bash: CLASSPATH: command not found[/code]

>

> And I don't recall how I decided to use

> .bash_profile, but .profile doesn't exist and I don't

> understand the syntax in .bashrc and it frightens me.

The norm is to make personal changes in .bashrc. The syntax for all these is the same - they are bash shell scripts. Post the full content of your .bash_profile.

sabre150a at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 12

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=.:$PATH:$HOME/bin:/sbin

CLASSPATH=.:$CLASSPATH:$HOME/Libraries/ext:$HOME/Libraries/i386

export PATH

export CLASSPATH

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 13

Change

PATH=.:$PATH:$HOME/bin:/sbin

CLASSPATH=.:$CLASSPATH:$HOME/Libraries/ext:$HOME/Libraries/i386

export PATH

export CLASSPATH

to

export PATH=.:$PATH:$HOME/bin:/sbin

export CLASSPATH=.:$CLASSPATH:$HOME/Libraries/ext:$HOME/Libraries/i386

sabre150a at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 14

I still get the CLASSPATH: Command not found error, even with your change

Which, by the way, happens also when I boot up the terminal, so at least I know it's using bash_profile

CoAa at 2007-7-29 14:46:41 > top of Java-index,Java Essentials,New To Java...
# 15

> I still get the CLASSPATH: Command not found error,

> even with your change

Post your latest .bash_profile

>

> Which, by the way, happens also when I boot up the

> terminal, so at least I know it's using bash_profile

.bash_profile is called and it normally sources .bashrc.

My FC7 .bash_profile contains

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

which show that if the .bashrc file exists it sources it and then prepends to the PATH.

I usually update .bashrc and /etc/bashrc .

sabre150a at 2007-7-29 14:46:45 > top of Java-index,Java Essentials,New To Java...
# 16

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

export PATH=.:$PATH:$HOME/bin:/sbin

export CLASSPATH=.:$CLASSPATH:$HOME/Libraries/ext:$HOME/Libraries/i386

CoAa at 2007-7-29 14:46:45 > top of Java-index,Java Essentials,New To Java...
# 17

Then I can't help you because that looks to be valid.

sabre150a at 2007-7-29 14:46:45 > top of Java-index,Java Essentials,New To Java...
# 18

Yeah ... it's odd, isn't it?

Does CLASSPATH need to be defined somewhere else?

CoAa at 2007-7-29 14:46:45 > top of Java-index,Java Essentials,New To Java...
# 19

Just for kicks, what does your .bashrc look like?

masijade.a at 2007-7-29 14:46:45 > top of Java-index,Java Essentials,New To Java...