LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   jdk not in correct path (http://www.linuxquestions.org/questions/slackware-14/jdk-not-in-correct-path-528965/)

angryfirelord 02-14-2007 07:56 AM

jdk not in correct path
 
I downloaded the jdk slack package from slackware-current and installed it successfully. Firefox seems to have picked it up, but if I type java or javac at the prompt, it can't find it. Doing a whereis java command reveals that it is located in /usr/lib/java. Is there a way to set it so that I can use it at the terminal & so Netbeans can find it?

gbonvehi 02-14-2007 08:12 AM

Code:

ln -s /usr/lib/java/javac /usr/bin
ln -s /usr/lib/java/java /usr/bin

I tought the symlinks were created automatically...

Edit: I've just checked, /usr/lib/java is added in the PATH variable by the file /etc/profile.d/jdk.sh (or jdk.csh, depends on your shell) which should be executed when you login. Maybe you're using runlevel 4 and you're not using a X terminal with the login option.

angryfirelord 04-07-2007 05:01 PM

I am using runlevel 5 (running XFCE). However, now the jdk & jre versions don't match up (1.5.0.9 & 1.6), so I'm going to try to use gcj instead.

I've created a simple Hello.java file:
Code:

class Hello{
        public static void main(String args[]){
                System.out.println("Hello!");
        }
}

Executing this gives me no errors:
Code:

gcj -c -g -O  Hello.java
Executing this gives me the following error:
Code:

java Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello

Any ideas on what I did wrong?

hitest 04-07-2007 06:24 PM

Quote:

Originally Posted by angryfirelord
I am using runlevel 5 (running XFCE).

Do you mean run level 4? Slackware uses run level 4 as graphical mode. Debian would be run level 5:-)

angryfirelord 04-07-2007 06:29 PM

Quote:

Originally Posted by hitest
Do you mean run level 4? Slackware uses run level 4 as graphical mode. Debian would be run level 5:-)

D'hoh! :newbie:
So what's the difference between runlevels 4 & 5?

duryodhan 04-07-2007 08:58 PM

Read the SlackBook that came with the DVD/CD.
Or
http://www.slackbook.org/

hitest 04-08-2007 10:14 AM

Quote:

Originally Posted by angryfirelord
D'hoh! :newbie:
So what's the difference between runlevels 4 & 5?

Slackware uses runlevel 1 for maintenance, as on other Linux distributions; runlevels 2, 3 and 5 identically configured for a console (with all services active); and runlevel 4 adds the X Window System.

* 0 - Halt
* 1 - Single
* 2 - Full multi-user NO display manager
* 3 - Full multi-user NO display manager
* 4 - Full multi-user with display manager (GUI)
* 5 - Not used/User definable
* 6 - Reboot

I copied the information from this article:

Runlevels


All times are GMT -5. The time now is 03:48 AM.