Cannot find java after successful openjdk 7 installation

I just installed openjdk7 by executing make install clean in /usr/ports/java/openjdk7 with no errors. However, when I try to execute a Java command I get a response saying
Code:
java: Command not found.
My first thought was that Java was installed to a location outside of my PATH, but I've searched all likely directories and I can't find it at all. I'm totally stumped now - I can't find the Java file but I didn't get any installation errors. Any suggestions?
 
You can verify it was installed and check out all installed files with pkg info -f openjdk7 (info your are using the new package tools) or pkg_info -f openjdk7 (with the old package tools). Perhaps you are using a shell that needs to rehash?
 
Psilotop said:
Code:
java: Command not found.
Did you rehash your shell? % rehash when using tcsh or $ hash -r when using (ba)sh.

java/openjdk7 installs java into /usr/local/bin. If it's not there, see if it's anywhere else ($ find / -name java 2>/dev/null in a (ba)sh shell). If not, it probably didn't install properly.
 
I did rehash, (I'm using tcsh) but it didn't help. Using pkg_info -f openjdk7 it looks like openjdk7 is not installed. Should I just rerun make install clean? I'm sorry if this is elementary, I'm new to Unix in general. It's just a single command so I don't know what mistakes I could have made installing the port.
 
Hmm, I just built java/openjdk7 myself without any problems. You did update your ports tree (# portsnap fetch update) before starting the build, right?

If there's no /var/db/pkg/openjdk-7-something directory on your system, the port wasn't installed properly. Trying again shouldn't hurt.
 
Yep, I ran portsnap fetch extract and portsnap fetch update this morning, before the install. I'm trying the installation again now.

That package is not in that directory, so it definitely didn't install properly. That's a really handy directory to know about, thank you.
 
I don't think I read carefully enough the first time around because I got an error when trying to install openjdk7 the second time around

Code:
===>  Installing for pkgconf-0.9.3                                              
===>  Checking if devel/pkgconf already installed                               
pkg_add: package 'pkgconf-0.9.3' conflicts with pkg-config-0.25_1               
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f to f
orce installation                                                               
*** Error code 1                                                                
                                                                                
Stop in /usr/ports/devel/pkgconf.                                               
*** Error code 1                                                                
                                                                                
Stop in /usr/ports/x11-fonts/fontconfig.                                        
*** Error code 1                                                                
                                                                                
Stop in /usr/ports/x11-fonts/dejavu.                                            
*** Error code 1                                                                
                                                                                
Stop in /usr/ports/x11-fonts/dejavu.                                            
*** Error code 1                                                                
                                                                                
Stop in /usr/ports/java/openjdk7.                                               
*** Error code 1                                                                
                                                                                
Stop in /usr/ports/java/openjdk7.

I guess the problem is this line:
Code:
pkg_add: package 'pkgconf-0.9.3' conflicts with pkg-config-0.25_1               
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f to f
I don't understand the conflict, though. How do two differently named packages conflict?
 
Psilotop said:
I don't understand the conflict, though. How do two differently named packages conflict?
Code:
[CMD=%]cat /jails/pointyhat/usr/ports/devel/pkgconf/pkg-descr[/CMD]
pkgconf is a program which helps to configure compiler and linker flags for
development frameworks. [highlight]It is similar to pkg-config, but was written from
scratch in Summer of 2011 to replace pkg-config[/highlight], which now needs itself to build
itself.
devel/pkg-config was deleted from the ports tree over a year ago. If you still have it around, it's probably easiest to first install ports-mgmt/portmaster, then do # portmaster -o devel/pkgconf devel/pkg-config and then try again with OpenJDK.
 
Ah, thanks for the thorough answer. That is incredibly helpful. I'll give that a try and see what happens.
 
After make install clean for portmaster, the portmaster commands are not found so I can't run that second line.

I'm running all of this on a FreeBSD jail in FreeNAS. I haven't updated either FreeNAS or the jail in about a year (if it's not broken...) and I'm guessing that's the reason that I'm having these conflicts. I just tried with a fresh install of the jail and everything is the same. A freshly installed OS shouldn't have trouble installing a port written for it, so I'm going to try and save myself some frustration and update both FreeNAS and the accompanying FreeBSD jail. At least this was a learning experience...
 
Your pkgconf is old.

For others reading this, I'm not sure if it's necessary but I ran:
Code:
portsnap fetch
portsnap extract
before this.

Go to devel/pkgconf, make deinstall, make reinstall. Go to java/openjdk8 and attempt to install again with make -DBATCH install clean
 
Your pkgconf is old.
Please check the date of a thread before responding. This thread is almost 4 years old, as can be seen from the date of the last post. The issues which were a thing have long been resolved now.

Also: portsnap extract is only needed when you install the Ports collection for the first time. When you have a ports collection you can simply use # portsnap fetch update to keep it up to date. See the portsnap(8) manualpage for more info on that.
 
Hi,

I installed openjdk12 from ports. I can see it is installed in /usr/local/openjdk12/bin/. Should I just add this to the PATH in order to run java from the command line? Or is there a better way like creating a symlink? If i decide to install Oracle JDK, how can i switch easily between the two?
 
... if i decide to install Oracle JDK ...
you won`t

... nothing will happen with that ...

Should I just add this to the PATH in order to run java from the command line?

yes (permanently) :

Code:
sham1810@freebsd:~# yourEditor /etc/csh.cshrc

# $FreeBSD: releng/12.0/bin/csh/csh.cshrc 337849 2018-08-15 14:41:24Z brd $
#
# System-wide .cshrc file for csh(1).
setenv JAVA_VERSION "12.0+"
setenv JAVA_HOME /usr/local/openjdk12
--
sham1810@freebsd:~# source /etc/csh.cshrc
--

sham1810@freebsd:~# java -version
java -version
openjdk version "12" 2019-04-16
OpenJDK Runtime Environment (build 12+12-2)
OpenJDK 64-Bit Server VM (build 12+12-2, mixed mode)
 
... nothing will happen with that ...
Why not?

Code:
The Java VM wrapper provides a convenient system for switching between
different Java VMs.  It also provides symbolic links in ${PREFIX}/bin to
allow the use of the Java executables without having to add the specific
Java VM executable directories to the PATH environment variable.
 
At quick glance that PR looks to be more for the ports infrastructure itself and is to allow building of Java ports using the various different Java engines.
 
At quick glance that PR looks to be more for the ports infrastructure itself and is to allow building of Java ports using the various different Java engines.
yes, true... openjdk11/12 is under daily "fine-grain" development and I presume no one asks for the vmwrapper. I personally don't know for what I should need that vmwrapper. But if you're interested in you could try it out(explain or even perhaps fix some things) and compare it to the relatively simple control "by hand" ( #16 )

I would be interested in what you`ll find out
 
I don't have enough Java experience for it, so I won't be able to fix or test certain issues. You seem a lot more qualified for it actually :)

I am actually looking at emulators/mame to maintain, but that's entirely unrelated to this.
 
--- /*off topic: --
I am actually looking at emulators/mame to maintain, but that's entirely unrelated to this.

great ! I personally only play Defender on my Apple II ....
Apple II seems to be supported by your port ? (which I didn't know exists):
-apple2: Attach a SCSI CD-ROM to the Apple II SCSI Card by default. [R. Belmont]
-apple2: Documented FocusDrive/ZIPDrive partition information format, and fixed it so it works. [R. Belmont]
...for coincidence I've got a real physical SCSI-ZipDrive on my AppleII ...
--- */------
... qualified for it actually :)....

I have to go to the dentist in 1/2 hour , could you start working on it in the meantime ? 😂 ..
 
Apple II seems to be supported by your port ? (which I didn't know exists):
Yes, I've been able to run it and try a few things. I also managed to build a Apple ][gs with a working mousedesk by adding a SCSI card and an empty CHD image as its disk. That was fun (I own an actual working Apple ][gs :) ) . I'm mostly using the 'traditional' MAME arcade emulations running original arcade games. I have a severe case of retro gaming fever.

MAME seems to have changed its release schedule some time ago and are now pushing out a new version at the end of each month. The update to 0.210 was simple, I wanted to take the opportunity and remove the Python 2.7 build dependency. But I'm getting a few weird build issues with Python 3.6 which I haven't been able to trace yet. I might do a quick fix for 0.211 now and push the other improvements a few versions forward.
 
Yes, I've been able to run it and try a few things. I also managed to build a Apple ][gs with a working mousedesk by adding a SCSI card and an empty CHD image as its disk. That was fun (I own an actual working Apple ][gs :) ) . I'm mostly using the 'traditional' MAME arcade emulations running original arcade games. I have a severe case of retro gaming fever.

MAME seems to have changed its release schedule some time ago and are now pushing out a new version at the end of each month. The update to 0.210 was simple, I wanted to take the opportunity and remove the Python 2.7 build dependency. But I'm getting a few weird build issues with Python 3.6 which I haven't been able to trace yet. I might do a quick fix for 0.211 now and push the other improvements a few versions forward.
great stuff you do while I have to go to the dentist now ;-)
I will take a closer look at your port at the next opportunity and am very curious

I put the java vm-switch thing to the HowtO department here :
#1
 
Back
Top