Classpath issues - Netbeans

OK I have been trying to install j3d for a while, then it occurred to me that it might possibly not have to do with my classpath issues, so I tried installing javamail, just as a test (not actually interested in using it).

javac won't find it

However, I tried with netbeans, adding new jars through the project/properties, and the thing STILL can't find it (javamail OR j3d). Netbeans ought to be able to work the command line properly to compile with the extra classes, right? So what's the deal?

btw - I'm using Linux (Fedora Core 6) and Idid post a similar problem in another topic on another forum. Sorry. The thread was going in a direction that wasn't helpful and a topic with 13 posts doesn't usually get new people responding to it.

[779 byte] By [CoAa] at [2007-11-27 11:21:44]
# 1

I don't see this thread resolving much better to be honest. You had good answers from sabre150 among others.

I think you need a Linux admin to get hands on to your system and find out where your variables are being overwritten.

Or

You can just set the classpath manually at compile rime and runtime.

cotton.ma at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 2

That's why I wanted the new thread, though. The problem isn't setting the classpath manually - I tried that. It didn't work. I was asking here if someone could guess why. Netbeans couldn't do it, the command line couldn't do it, environment variables couldn't do it.

I've got the classpath RIGHT now, but it still won't work and THAT'S why I need help.

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 3

> That's why I wanted the new thread, though. The

> problem isn't setting the classpath manually - I

> tried that.

No.

I said at compile time and runtime. In your last thread you are setting the classpath in bash or whatnot.

I am not talking about an environment variable here. I am talking about a switch to java and javac. This is something different.

cotton.ma at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 4

That's why I wanted a new thread, because I changed the problem. OK?

I've tried this:

javac -classpath /home/rodya/Libraries/ext/j3dutils.jar Ex3d.java

And gotten this:

Ex3d.java:1: package com does not exist

import com.sun;

Now is that different than what you're saying and I'm just not getting it?

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 5

> That's why I wanted a new thread, because I

> changed the problem. OK?

>

> I've tried this:

> javac -classpath

> /home/rodya/Libraries/ext/j3dutils.jar Ex3d.java

>

>

> And gotten this:

> Ex3d.java:1: package com does not exist

> import com.sun;

>

> Now is that different than what you're saying and I'm

> just not getting it?

No that's the same.

That's an invalid import statement. That's your problem there. What is the package you are trying to import (ignoring for a moment that you shouldn't import sun anything packages).?

The compiler thinks you are trying to import a class named sun from a package named com. But that does not exist.

cotton.ma at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 6

OK here's a more valid thing if you like:

javac -classpath /home/rodya/Libraries/ext/j3dutils.jar Ex3d.java

Ex3d.java:1: package com.sun.j3d.utils does not exist

import com.sun.j3d.utils.*;

That is a valid import statement and it still doesn't work. I am trying to use Java3D, which includes the proper structure for com/sun/j3d/utils/(etc) inside the j3dutils.jar, which is what I am trying to include.

Furthermore I can import these things if I want - there's nothing wrong with using external libraries, as they are open-source and can be distributed with your program if distribution needs to happen. Even if it does say sun on it.

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 7

Where is the Ex3d.java source file located?

cotton.ma at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 8

/home/rodya/Programming/Game/3d

Why?

I'm pretty sure it's not a permissions issue, as I created every file, but also it doesn't work as root, either.

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 9

No other ideas?

;_;

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 10

> No other ideas?

>

> ;_;

Can you import non sun packages at all?

Just wondering...

cotton.ma at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 11

I don't THINK so.... I tried javamail which doesn't say sun explicitly, and didn't work...

Do you have any other suggestions to try?

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 12

I've just had a look at the j3d documentation (java3d-1_5_1-api-docs) and there doesn't seem to be a com.sun.j3d.utils package. Packages are not hierarchical, so you have to import com.sun.j3d.utils.applet.* com.sun.j3d.utils.audio.* etc.

pbrockway2a at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 13

> I don't THINK so.... I tried javamail which doesn't

> say sun explicitly, and didn't work...

>

> Do you have any other suggestions to try?

No sorry. I was hoping this was some sort of java security thing. I have no idea.

I honestly think you need a Linux/Java person who can give you one on one support. There is something fishy in your setup but I have no clue what it might be.

Again sorry.

cotton.ma at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 14

OMG

I can't believe that was the fix... I never would have thought to try that.

There goes 8 hours.... bleh.

Thanks though! Thank you very very much!

CoAa at 2007-7-29 14:50:44 > top of Java-index,Java Essentials,Java Programming...
# 15

> I can't believe that was the fix... I never would have thought to try that.

The ... . applet.*, ... .audio.* thing? If so, you're welcome. Another reason to import each class with its own import statement. (Hard work unless an IDE does it for you!)

pbrockway2a at 2007-7-29 14:50:49 > top of Java-index,Java Essentials,Java Programming...