DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd July 2015
mattthumper mattthumper is offline
Real Name: Matt Morrow
Port Guard
 
Join Date: Jul 2015
Location: Virginia, USA
Posts: 20
Default Netbeans and jdk1.7.0_03

Hello,

I am an OpenBSD (5.7) newbie, so please be patient!

Netbeans needs java jdk1.7.0_03 -

Code:
> netbeans
Error: JAVA_HOME is not defined correctly: /usr/java/jdk1.7.0_03
       Unable to find /usr/java/jdk1.7.0_03/bin/java or it is not executable
a) I do not have any java (ksh: java: not found)
b) I've tried pkg_add for java, jdk, jdk1.7.0_03 with no packages added

Where do I go from here?
What should I do to resolve the Error (displayed above)?

TIA,
Matt

Last edited by ocicat; 22nd July 2015 at 02:13 PM. Reason: Please use [code] & [/code] tags when posting command output.
Reply With Quote
  #2   (View Single Post)  
Old 22nd July 2015
blackhole's Avatar
blackhole blackhole is offline
Spam Deminer
 
Join Date: Mar 2014
Posts: 314
Default

Considering netbeans will pull in the jdk package as a dependency, how was netbeans installed?
Reply With Quote
  #3   (View Single Post)  
Old 22nd July 2015
mattthumper mattthumper is offline
Real Name: Matt Morrow
Port Guard
 
Join Date: Jul 2015
Location: Virginia, USA
Posts: 20
Default

Cynwulf,

Thanks for the quick response.

As root I did:
pkg_add netbeans

(btw, I guess it did netbeans-6.9.1p5)

I also did a pkg_delete netbeans and then another pkg_add with the same results.

-Matt

Last edited by mattthumper; 22nd July 2015 at 01:34 PM.
Reply With Quote
  #4   (View Single Post)  
Old 22nd July 2015
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Run
Code:
$ javaPathHelper -h netbeans
and report back with the output.
Reply With Quote
  #5   (View Single Post)  
Old 22nd July 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Hello, and welcome!

1. The output of $ pkg_info will list every installed package. If jdk is installed, it will be listed. I'll bet it is listed.

2. /usr/java doesn't exist on OpenBSD. You can't use your prior knowledge of file locations from other OSes on OpenBSD. More likely, this is in /usr/local/lib but to confirm, use the -L option of pkg_info(1), which will list every file installed with the package.
Reply With Quote
  #6   (View Single Post)  
Old 22nd July 2015
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Quote:
Originally Posted by jggimi View Post
More likely, this is in /usr/local/lib but to confirm, use the -L option of pkg_info(1), which will list every file installed with the package.
The default installation of jdk-1.7 is in /usr/local/jdk-1.7.0, which notably outside the default PATH.

Also, the script you run when you type $ netbeans at the command line can be found here:
http://cvsweb.openbsd.org/cgi-bin/cv...ype=text/plain
Reply With Quote
  #7   (View Single Post)  
Old 22nd July 2015
mattthumper mattthumper is offline
Real Name: Matt Morrow
Port Guard
 
Join Date: Jul 2015
Location: Virginia, USA
Posts: 20
Default

Quote:
Originally Posted by ibara View Post
Run
Code:
$ javaPathHelper -h netbeans
and report back with the output.
ibara,
Thanks for the response.

Here's what I get:
Code:
>   javaPathHelper -h netbeans
Error: JAVA_HOME is not defined correctly: /usr/java/jdk1.7.0_03
       Unable to find /usr/java/jdk1.7.0_03/bin/java or it is not executable

Last edited by ocicat; 22nd July 2015 at 02:11 PM. Reason: Please use [code] & [/code] tags when posting console output.
Reply With Quote
  #8   (View Single Post)  
Old 22nd July 2015
mattthumper mattthumper is offline
Real Name: Matt Morrow
Port Guard
 
Join Date: Jul 2015
Location: Virginia, USA
Posts: 20
Default

Thanks again for the replies.

pkg_info shows a jdk. Just not the one 'needed' by netbeans:
Code:
.
.
.
.iso-codes-3.57      lists of the country, language and currency iso names
iso8879-1986p0      character entity sets from ISO 8879:1986 (SGML)
jasper-1.900.1p2    reference implementation of JPEG-2000
javaPathHelper-0.3p1 helper script for launching java applications
jbig2dec-0.11       decoder for JBIG2 monochrome hi-res image compression format
jdk-1.7.0.71v0      Java2(TM) SE Dev Kit v1.7.0.71
jpeg-9a             IJG's JPEG compression utilities
json-c-0.12         JSON implementation in C
json-glib-1.0.2     JSON parser for GLib-based libraries and applications
kde-dev-scripts-4.14.3 KDE development helper scripts
kde-shared-data-4.14.3 common run-time components for KDE3 and KDE4
kde3-locale-3.5.10p0 K Desktop Environment, locale data files
kde4-kopete-sounds-4.14.3 notification sounds for Kopete
kde4-langlist-4.14.3 list of languages supported by KDE
kde4-locale-en_US-4.14.3 KDE en_US locale data
kdelibs-3.5.10p34   K Desktop Environment, libraries
lame-3.99.5         lame ain't an MP3 encoder
lcms-1.18a          color management library
.
.
.
So I did:
Code:
# ls -lisa /usr/local/jdk-1.7.0
total 44584
25984     4 drwxr-xr-x   9 root  root       512 Jul 21 18:48 .
    2     4 drwxr-xr-x  13 root  root       512 Jul 22 09:28 ..
26222     4 -r--r--r--   1 root  bin       1503 Mar  6 19:42 ASSEMBLY_EXCEPTION
26224    40 -r--r--r--   1 root  bin      19263 Mar  6 19:42 LICENSE
26226   340 -r--r--r--   1 root  bin     172252 Mar  6 19:42 THIRD_PARTY_README
25985     4 drwxr-xr-x   2 root  root      1024 Jul 21 18:48 bin
26025     4 drwxr-xr-x  10 root  root       512 Jul 21 18:48 demo
52265     4 drwxr-xr-x   3 root  root       512 Jul 21 18:48 include
26118     4 drwxr-xr-x   4 root  root       512 Jul 21 18:48 jre
26214     4 drwxr-xr-x   2 root  root       512 Jul 21 18:48 lib
51968     4 drwxr-xr-x   4 root  root       512 Jul 21 18:50 man
26507     4 -r--r--r--   1 root  bin         74 Mar  6 19:43 release
52011     4 drwxr-xr-x   7 root  root       512 Jul 21 18:48 sample
26220 44160 -r--r--r--   1 root  bin   22593504 Mar  6 19:43 src.zip
That's a good starting place!
Thanks again.

Any other pointers or tips will be appreciated.
My head is kinda' sore from banging it against the OpenBSD wall.
; - )

Last edited by ocicat; 22nd July 2015 at 02:22 PM. Reason: Please use [code] & [/code] tags when posting console output.
Reply With Quote
  #9   (View Single Post)  
Old 22nd July 2015
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Does this allow netbeans to launch?

Code:
$ PATH=/usr/local/jdk-1.7.0/bin:$PATH exec /usr/local/netbeans/bin/netbeans --jdkhome /usr/local/jdk-1.7.0
Reply With Quote
Old 22nd July 2015
mattthumper mattthumper is offline
Real Name: Matt Morrow
Port Guard
 
Join Date: Jul 2015
Location: Virginia, USA
Posts: 20
Thumbs up

Quote:
Originally Posted by ibara View Post
Does this allow netbeans to launch?

Code:
$ PATH=/usr/local/jdk-1.7.0/bin:$PATH exec /usr/local/netbeans/bin/netbeans --jdkhome /usr/local/jdk-1.7.0
It works!

Thanks for all the help everyone.
I can add these new things into my notes for future reference - and not have to ask for help for related issues - I hope!

I'll set my $PATH and $JAVA_HOME (?) accordingly.
Reply With Quote
Old 22nd July 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by mattthumper View Post
Code:
> netbeans
Error: JAVA_HOME is not defined correctly: /usr/java/jdk1.7.0_03
       Unable to find /usr/java/jdk1.7.0_03/bin/java or it is not executable
Now that it has been established that the fundamental problem was a path accessibility issue, something you (& other readers finding this thread later...) might want to explore is whether it makes sense to make symlinks to an accessible directory similar to what is done with Python 2.7.10. If this is not clear, below is a snippet of what is displayed following the installation of Python:
Code:
If you want to use this package as your default system python, as root
create symbolic links like so (overwriting any previous default):
 ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
 ln -sf /usr/local/bin/python2.7-2to3 /usr/local/bin/2to3
 ln -sf /usr/local/bin/python2.7-config /usr/local/bin/python-config
 ln -sf /usr/local/bin/pydoc2.7  /usr/local/bin/pydoc
I do a similar configuration on Java in the few situations I ever use it, & I have not the vagaries seen here.

FWIW.
Reply With Quote
Old 22nd July 2015
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Quote:
Originally Posted by ocicat View Post
Now that it has been established that the fundamental problem was a path accessibility issue
The underlying problem is slightly more subtle. While being aware of path accessibility did fix the symptom, something is broken with either the jdk or javaPathHelper package.

The source of that problem though, I have no idea. Could be user error, a bad mirror, or a bad package. I don't have a 5.7-release machine nor the time to figure that out.

Quote:
Originally Posted by mattthumper View Post
I'll set my $PATH and $JAVA_HOME (?) accordingly.
It would be better if you did the following:
Code:
$ cd ~
$ mkdir -p bin
$ echo '#!/bin/sh' > bin/netbeans
$ echo 'PATH=/usr/local/jdk-1.7.0/bin:$PATH exec /usr/local/netbeans/bin/netbeans --jdkhome /usr/local/jdk-1.7.0' >> bin/netbeans
Reply With Quote
Reply

Tags
java, java jdk, netbeans

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Netbeans running application problem. bsdnewbie999 Programming 7 2nd November 2015 10:44 PM
Java SE and Netbeans on OpenBSD? SunSpyda OpenBSD Packages and Ports 7 17th May 2009 09:45 PM
netbeans 6.0.1 not run cuongvt FreeBSD General 5 6th June 2008 03:13 PM
[java] netbeans 6.0.1 and applets not work Mak-Di FreeBSD General 1 12th May 2008 06:04 PM


All times are GMT. The time now is 09:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick