2

I am using ubuntu 16.04, and my java is in /usr/bin/java and jdk is in /usr/lib/jvm/java-8-openjdk-amd64 . non of these had the javapackager inside. I am not able to use javapackager command and do not know how to configure it to use in command-line. Can anyone help me? Thanks.

RRy
  • 433
  • 1
  • 5
  • 15
  • Could you please provide the command/s you are trying to execute and the output you get? – Twahanz Jun 15 '16 at 15:28
  • Thank you for your reply. I did not have the javapackager in $JAVA_HOME/bin and I noticed that openjdk does not come with javapackager and had to install oracle jdk – RRy Jun 15 '16 at 15:57

2 Answers2

1

It seems javapackager comes with a package called openjfx, so running apt install openjfx should make the tool available for you, among your other java tools.

$ apt-file search javapackager
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/bin/javapackager
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1/javapackager.1.gz
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javapackager.1.gz
0

You should define your java path.

You can set your JAVA_HOME in /etc/profile as Petronilla Escarabajo suggests. But the preferred location for JAVA_HOME or any system variable is /etc/environment.

Open /etc/environment in any text editor like nano or gedit and add the following

JAVA_HOME="/usr/lib/jvm/open-jdk" (java path could be different)

Use source to load the variables, by running this command:

source /etc/environment Then check the variable, by running this command:

echo $JAVA_HOME
r007
  • 305
  • 1
  • 2
  • 17
  • 1
    Thank you for your reply. But as I said I did not have the javapackager in $JAVA_HOME/bin and I noticed that openjdk does not come with javapackager and had to install oracle jdk. – RRy Jun 15 '16 at 15:54
  • But your answer was helpful. And if you want you can mention my point in your answer for people who do not read the comments. Thanks. – RRy Jun 15 '16 at 16:05