pkg: /usr/local/bin/java was not found in the database

Anton Shterenlikht mexas at bris.ac.uk
Mon May 16 12:42:52 UTC 2016


I'm trying to resolve some java/OpenGL errors.
I know nothing about java and next to nothing
about OpenGL. I just want to run a particular application.

Anyway, in an attempt to get to the bottom of my
errors [1], I'm trying to run any java/OpenGL
locally on my 11-current laptop. I'm starting
with java, something very simple, e.g.:
 http://www.skylit.com/javamethods/faqs/javaindos.html

$ cat HelloWorld.java 
public class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Hello, World!");
  }
}

I get:

$ javac HelloWorld.java 
$ java HelloWorld.class 
Error: Could not find or load main class HelloWorld.class

This should've worked.
So I wanted to check which java and javac I'm using:

$ pkg which /usr/local/bin/java
/usr/local/bin/java was not found in the database
$ pkg which /usr/local/bin/javac 
/usr/local/bin/javac was not found in the database
$ 

Is there something wrong with my java packages?
I've
 openjdk8-8.77.3                java/openjdk8

but that seems to store binaries in different folder:

$ pkg info -xl openjd | grep java |grep bin
        /usr/local/openjdk8/bin/java
        /usr/local/openjdk8/bin/java-rmi.cgi
        /usr/local/openjdk8/bin/javac
        /usr/local/openjdk8/bin/javadoc
        /usr/local/openjdk8/bin/javah
        /usr/local/openjdk8/bin/javap
        /usr/local/openjdk8/jre/bin/java

So I'm not sure what's going on.

Please advise how to test a working java environment.

Thanks

Anton

[1] http://lists.freebsd.org/pipermail/freebsd-java/2016-May/011537.html


More information about the freebsd-java mailing list