# OpenBSD: Java Command not found



## crookedmaze

Hello I am having trouble getting java to work on OpenBSD.

First I installed the jdk and jre


Code:


pkg_add jdk

pkg_add jre

Then I did 


Code:


java -version

and I got the message ksh: java not found. The weird thing is that netbeans works just fine and Im pretty sure that its in java. So it might just be the commands that arn't working? Does anyone know how I could fix this? Thank for reading my post! - Crookedmaze

Also in netbeans I was able to make a Hello world application in java so I know the java jdk is in fact working.....


----------



## crookedmaze

help please!


----------



## crookedmaze

I figured it out instead of java -version you have to do /usr/local/jdk-1.7.0/bin/java -version


----------



## hal8000

PATHS are different in BSD than linux

The location may be shown with "which" command

e.g.

[[email protected] ~]# which java
/usr/bin/java


----------

