Re: Maven won't pick up JAVA_HOME

2017-11-27 Thread cen
Case closed. Turns out I had improper JAVA_HOME defined in ~/.mavenrc 
which overrides user env and that is why it worked as root. I had to 
debug the mvn bash script to get to the core of it. Too bad maven fails 
with not much info in case like this. If you run with -X it could at 
least tell you the current config and where it is taking the vars. :sadface:


Thanks everyone for given help.
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-27 Thread cen
Small update: I nuked all presence of java and maven with dnf autoremove 
and then reinstalled maven and it did indeed install all the necessary 
packages and now I also see the jre folder in the /usr/lib/jvm/... but 
still! the same error. What is more interesting though is that if I 
switch to root user, maven suddenly works. So it must be something going 
on with my user shell. Investigating further..

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-27 Thread Ed Greshko
On 11/27/17 18:37, cen wrote:
> Yes, apparently I did have JAVA_HOME set. After unsetting the variable and
> reinstalling maven again it completed successfully. However, problem persists:
>
> mvn -version
> /usr/bin/mvn: Failed to set JAVACMD
> The JAVA_HOME environment variable is not defined correctly
> This environment variable is needed to run this program
> NB: JAVA_HOME should point to a JDK not a JRE
>
>
> One other thing I found after install is this:
> pwd
> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/bin
> ./java -version
> Error: could not find libjava.so
> Error: Could not find Java SE Runtime Environment.
>
> So this java 8 install as a weak maven dependency seems to be borked.


FWIW, I restored the snapshot of my VM so that no java packages or maven was
installed.  I then did a "dnf install maven" and these are the packages it 
installed.

[root@f27k ~]# dnf history info 10
Transaction ID : 10
Begin time : Mon 27 Nov 2017 06:34:09 PM CST
Begin rpmdb    : 1753:e25030afa94192d6bc3a19187b358d4e713ba416
End time   : Mon 27 Nov 2017 06:34:51 PM CST (42 seconds)
End rpmdb  : 1807:3332cf3d346b1478137488d8703e1278c79fba89
User   : Ed Greshko 
Return-Code    : Success
Command Line   : install maven
Transaction performed with:
    Installed dnf-2.7.5-1.fc27.noarch  @updates
    Installed rpm-4.14.0-2.fc27.x86_64 @anaconda
Packages Altered:
    Install aopalliance-1.0-15.fc27.noarch  @fedora
    Install apache-commons-cli-1.4-2.fc27.noarch    @fedora
    Install apache-commons-codec-1.10-5.fc27.noarch @fedora
    Install apache-commons-io-1:2.5-3.fc27.noarch   @fedora
    Install apache-commons-lang-2.6-20.fc27.noarch  @fedora
    Install apache-commons-lang3-3.6-3.fc27.noarch  @fedora
    Install apache-commons-logging-1.2-11.fc27.noarch   @fedora
    Install atinject-1-25.20100611svn86.fc27.noarch @fedora
    Install cdi-api-1.2-5.fc27.noarch   @fedora
    Install copy-jdk-configs-3.3-1.fc27.noarch  @updates
    Install glassfish-el-api-3.0.1-0.5.b08.fc27.noarch  @fedora
    Install google-guice-4.1-8.fc27.noarch  @fedora
    Install guava-18.0-11.fc27.noarch   @fedora
    Install hawtjni-runtime-1.15-2.fc27.noarch  @fedora
    Install httpcomponents-client-4.5.3-4.fc27.noarch   @fedora
    Install httpcomponents-core-4.4.6-4.fc27.noarch @fedora
    Install jansi-1.16-2.fc27.noarch    @fedora
    Install jansi-native-1.7-3.fc27.x86_64  @fedora
    Install java-1.8.0-openjdk-1:1.8.0.151-1.b12.fc27.x86_64    @updates
    Install java-1.8.0-openjdk-devel-1:1.8.0.151-1.b12.fc27.x86_64  @updates
    Install java-1.8.0-openjdk-headless-1:1.8.0.151-1.b12.fc27.x86_64   @updates
    Install javapackages-tools-5.0.0-7.fc27.noarch  @fedora
    Install jboss-interceptors-1.2-api-1.0.0-7.fc27.noarch  @fedora
    Install jcl-over-slf4j-1.7.25-2.fc27.noarch @fedora
    Install jsoup-1.10.3-2.fc27.noarch  @fedora
    Install lksctp-tools-1.0.16-8.fc27.x86_64   @fedora
    Install lua-5.3.4-6.fc27.x86_64 @updates
    Install lua-posix-33.3.1-7.fc27.x86_64  @fedora
    Install maven-1:3.5.0-6.fc27.noarch @fedora
    Install maven-lib-1:3.5.0-6.fc27.noarch @fedora
    Install maven-resolver-api-1:1.0.3-7.fc27.noarch    @fedora
    Install maven-resolver-connector-basic-1:1.0.3-7.fc27.noarch    @fedora
    Install maven-resolver-impl-1:1.0.3-7.fc27.noarch   @fedora
    Install maven-resolver-spi-1:1.0.3-7.fc27.noarch    @fedora
    Install maven-resolver-transport-wagon-1:1.0.3-7.fc27.noarch    @fedora
    Install maven-resolver-util-1:1.0.3-7.fc27.noarch   @fedora
    Install maven-shared-utils-3.1.0-5.fc27.noarch  @fedora
    Install maven-wagon-file-2.10-4.fc27.noarch @fedora
    Install maven-wagon-http-2.10-4.fc27.noarch @fedora
    Install maven-wagon-http-shared-2.10-4.fc27.noarch  @fedora
    Install maven-wagon-provider-api-2.10-4.fc27.noarch @fedora
    Install plexus-cipher-1.7-13.fc27.noarch    @fedora
    Install plexus-classworlds-2.5.2-8.fc27.noarch  @fedora
    Install plexus-containers-component-annotations-1.7.1-3.fc27.noarch @fedora
    Install plexus-interpolation-1.22-8.fc27.noarch

Re: Maven won't pick up JAVA_HOME

2017-11-27 Thread cen

On 11/27/2017 11:00 AM, Ed Greshko wrote:

On 11/27/17 16:53, cen wrote:

On 11/27/2017 01:51 AM, Ed Greshko wrote:

On 11/27/17 07:39, Ed Greshko wrote:

I suppose I could give it a try with java-9 on a VM.  If that is what you 
require.

As previously noted.  I got

[egreshko@acer ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.15-300.fc27.x86_64", arch: "amd64", family: 
"unix"

on my default testing system.

Note that the Java home points to a "jre" directory.

Installing java-9 on a VM shows there to be no jre supplied with java-9.  So, I 
think
one must be content with running java-1.8 with maven.


That can't be true because I used maven with java 9 in F26 from updates-testing
with absolutely no problems. And I have same problem with java 8 anyway.

After removing all versions of java and maven with dnf I tried to do a fresh
install and now even that fails:

Install package 'maven' to provide command 'mvn'? [N/y] y


  * Waiting in queue...
  * Loading list of packages
  * Downloading details about the software sources
  * Loading list of packages
  * Downloading details about the software sources
  * Loading list of packages
The following packages have to be installed:
  java-1.8.0-openjdk-devel-1:1.8.0.151-1.b12.fc27.x86_64    OpenJDK Development
Environment
  maven-1:3.5.0-6.fc27.noarch    Java project management and project 
comprehension tool
Proceed with changes? [N/y] y


  * Waiting in queue...
  * Waiting for authentication...
  * Waiting in queue...
  * Downloading packages...
  * Requesting data...
  * Testing changes...
  * Installing packages...
/usr/bin/mvn: Failed to set JAVACMD
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

Something on my system seems to be off and I have no idea what.


2 things.  First, you noticed that part of the message you got during the 
install
says

The following packages have to be installed:
  java-1.8.0-openjdk-devel-1:1.8.0.151-1.b12.fc27.x86_64    OpenJDK Development
Environment

Which is telling you that maven is depending on java-1.8.

Second, a question.  When you ran the command did you have JAVA_HOME set?  If 
you
did, how about trying it again without it being set?



Yes, apparently I did have JAVA_HOME set. After unsetting the variable 
and reinstalling maven again it completed successfully. However, problem 
persists:


mvn -version
/usr/bin/mvn: Failed to set JAVACMD
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE


One other thing I found after install is this:
pwd
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/bin
./java -version
Error: could not find libjava.so
Error: Could not find Java SE Runtime Environment.

So this java 8 install as a weak maven dependency seems to be borked.




___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-27 Thread Ed Greshko
On 11/27/17 16:53, cen wrote:
>
> On 11/27/2017 01:51 AM, Ed Greshko wrote:
>> On 11/27/17 07:39, Ed Greshko wrote:
>>> I suppose I could give it a try with java-9 on a VM.  If that is what you 
>>> require.
>> As previously noted.  I got
>>
>> [egreshko@acer ~]$ mvn -v
>> Apache Maven 3.5.0 (Red Hat 3.5.0-6)
>> Maven home: /usr/share/maven
>> Java version: 1.8.0_151, vendor: Oracle Corporation
>> Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
>> Default locale: en_US, platform encoding: UTF-8
>> OS name: "linux", version: "4.13.15-300.fc27.x86_64", arch: "amd64", family: 
>> "unix"
>>
>> on my default testing system.
>>
>> Note that the Java home points to a "jre" directory.
>>
>> Installing java-9 on a VM shows there to be no jre supplied with java-9.  
>> So, I think
>> one must be content with running java-1.8 with maven.
>>
> That can't be true because I used maven with java 9 in F26 from 
> updates-testing
> with absolutely no problems. And I have same problem with java 8 anyway.
>
> After removing all versions of java and maven with dnf I tried to do a fresh
> install and now even that fails:
>
> Install package 'maven' to provide command 'mvn'? [N/y] y
>
>
>  * Waiting in queue...
>  * Loading list of packages
>  * Downloading details about the software sources
>  * Loading list of packages
>  * Downloading details about the software sources
>  * Loading list of packages
> The following packages have to be installed:
>  java-1.8.0-openjdk-devel-1:1.8.0.151-1.b12.fc27.x86_64    OpenJDK Development
> Environment
>  maven-1:3.5.0-6.fc27.noarch    Java project management and project 
> comprehension tool
> Proceed with changes? [N/y] y
>
>
>  * Waiting in queue...
>  * Waiting for authentication...
>  * Waiting in queue...
>  * Downloading packages...
>  * Requesting data...
>  * Testing changes...
>  * Installing packages...
> /usr/bin/mvn: Failed to set JAVACMD
> The JAVA_HOME environment variable is not defined correctly
> This environment variable is needed to run this program
> NB: JAVA_HOME should point to a JDK not a JRE
>
> Something on my system seems to be off and I have no idea what. 


2 things.  First, you noticed that part of the message you got during the 
install
says 

The following packages have to be installed:
 java-1.8.0-openjdk-devel-1:1.8.0.151-1.b12.fc27.x86_64    OpenJDK Development
Environment

Which is telling you that maven is depending on java-1.8.

Second, a question.  When you ran the command did you have JAVA_HOME set?  If 
you
did, how about trying it again without it being set?



-- 
Fedora Users List - The place to go to speculate endlessly



signature.asc
Description: OpenPGP digital signature
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-27 Thread cen


On 11/27/2017 01:51 AM, Ed Greshko wrote:

On 11/27/17 07:39, Ed Greshko wrote:

I suppose I could give it a try with java-9 on a VM.  If that is what you 
require.


As previously noted.  I got

[egreshko@acer ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.15-300.fc27.x86_64", arch: "amd64", family: 
"unix"

on my default testing system.

Note that the Java home points to a "jre" directory.

Installing java-9 on a VM shows there to be no jre supplied with java-9.  So, I 
think
one must be content with running java-1.8 with maven.

That can't be true because I used maven with java 9 in F26 from 
updates-testing with absolutely no problems. And I have same problem 
with java 8 anyway.


After removing all versions of java and maven with dnf I tried to do a 
fresh install and now even that fails:


Install package 'maven' to provide command 'mvn'? [N/y] y


 * Waiting in queue...
 * Loading list of packages
 * Downloading details about the software sources
 * Loading list of packages
 * Downloading details about the software sources
 * Loading list of packages
The following packages have to be installed:
 java-1.8.0-openjdk-devel-1:1.8.0.151-1.b12.fc27.x86_64    OpenJDK 
Development Environment
 maven-1:3.5.0-6.fc27.noarch    Java project management and project 
comprehension tool

Proceed with changes? [N/y] y


 * Waiting in queue...
 * Waiting for authentication...
 * Waiting in queue...
 * Downloading packages...
 * Requesting data...
 * Testing changes...
 * Installing packages...
/usr/bin/mvn: Failed to set JAVACMD
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

Something on my system seems to be off and I have no idea what.


___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ed Greshko
On 11/27/17 07:39, Ed Greshko wrote:
> I suppose I could give it a try with java-9 on a VM.  If that is what you 
> require.


As previously noted.  I got

[egreshko@acer ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.15-300.fc27.x86_64", arch: "amd64", family: 
"unix"

on my default testing system.

Note that the Java home points to a "jre" directory.

Installing java-9 on a VM shows there to be no jre supplied with java-9.  So, I 
think
one must be content with running java-1.8 with maven.

-- 
Fedora Users List - The place to go to speculate endlessly



signature.asc
Description: OpenPGP digital signature
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ed Greshko
On 11/27/17 07:13, cen wrote:
> I feel like my problem is something deeper or something silly at this point..
>
>
> sudo dnf install java-9-openjdk-devel
> Last metadata expiration check: 0:00:00 ago on Mon 27 Nov 2017 12:09:07 AM 
> CET.
> Package java-9-openjdk-devel-1:9.0.0.181-7.fc27.x86_64 is already installed, 
> skipping.
> Dependencies resolved.
> Nothing to do.
> Complete!
>
> export JAVA_HOME=/etc/alternatives/java_sdk_9_openjdk
>
> mvn -v
> The JAVA_HOME environment variable is not defined correctly
> This environment variable is needed to run this program
> NB: JAVA_HOME should point to a JDK not a JRE


I have a "default" F27 KDE system on a testing laptop.  I don't know if you 
have a
requirement to use java-9.  But in the "default" system java 1.8 is installed.

I just installed maven and it added

Installing weak dependencies:
 java-1.8.0-openjdk-devel x86_64 1:1.8.0.151-1.b12.fc27  updates 
9.8 M

I have

java-1.8.0-openjdk-headless-1.8.0.151-1.b12.fc27.x86_64
javapackages-tools-5.0.0-7.fc27.noarch
java-1.8.0-openjdk-devel-1.8.0.151-1.b12.fc27.x86_64
java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64

installed and no JAVA_HOME

[egreshko@acer ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.15-300.fc27.x86_64", arch: "amd64", family: 
"unix"


I suppose I could give it a try with java-9 on a VM.  If that is what you 
require.




-- 
Fedora Users List - The place to go to speculate endlessly



signature.asc
Description: OpenPGP digital signature
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread cen
I feel like my problem is something deeper or something silly at this 
point..



sudo dnf install java-9-openjdk-devel
Last metadata expiration check: 0:00:00 ago on Mon 27 Nov 2017 12:09:07 
AM CET.
Package java-9-openjdk-devel-1:9.0.0.181-7.fc27.x86_64 is already 
installed, skipping.

Dependencies resolved.
Nothing to do.
Complete!

export JAVA_HOME=/etc/alternatives/java_sdk_9_openjdk

mvn -v
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE


On 11/26/2017 11:54 PM, Ulf Volmer wrote:

On 26.11.2017 23:02, Ulf Volmer wrote:

On 26.11.2017 22:43, cen wrote:


1. sudo dnf install maven
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

is java-1.8.0-openjdk-devel installed?

sorry i did not read your post correctly. especially that you are using
java 9. So again my question:

is java-9-openjdk-devel installed?

[ulf@fc27-x1 ~]$ export JAVA_HOME=/etc/alternatives/java_sdk_9_openjdk
[ulf@fc27-x1 ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 9.0.1, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-9-openjdk-9.0.1.11-1.fc27.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.12-300.fc27.x86_64", arch: "amd64",
family: "unix"

best regards
Ulf
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ulf Volmer
On 26.11.2017 23:02, Ulf Volmer wrote:
> On 26.11.2017 22:43, cen wrote:
> 
>> 1. sudo dnf install maven
> 
>> The JAVA_HOME environment variable is not defined correctly
>> This environment variable is needed to run this program
>> NB: JAVA_HOME should point to a JDK not a JRE
> 
> is java-1.8.0-openjdk-devel installed?

sorry i did not read your post correctly. especially that you are using
java 9. So again my question:

is java-9-openjdk-devel installed?

[ulf@fc27-x1 ~]$ export JAVA_HOME=/etc/alternatives/java_sdk_9_openjdk
[ulf@fc27-x1 ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 9.0.1, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-9-openjdk-9.0.1.11-1.fc27.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.12-300.fc27.x86_64", arch: "amd64",
family: "unix"

best regards
Ulf
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ed Greshko
On 11/27/17 06:28, cen wrote:
>
> Hm, there is no jre directory.
>

On my system

[egreshko@meimei jvm]$ ls /usr/lib/jvm/java/jre/
bin  lib


>
> On 11/26/2017 11:08 PM, Ed Greshko wrote:
>> On 11/27/17 05:43, cen wrote:
>>> Perhaps I am just going crazy but maven just won't pick up JAVA_HOME on F27.
>>>
>>> 1. sudo dnf install maven
>>>
>>> 2. echo $JAVA_HOME returns 
>>> /usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64
>>> (which includes bin dir with JDK tools such as javac, keytool etc so it is 
>>> JDK for
>>> sure)
>>>
>>> 3. Any mvn command results in
>>>
>>> The JAVA_HOME environment variable is not defined correctly
>>> This environment variable is needed to run this program
>>> NB: JAVA_HOME should point to a JDK not a JRE
>>>
>>>
>>> Also tried JDK8 and Oracel Java 9
>>>
>>> export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64
>>>
>>> export JAVA_HOME=/usr/java/jdk-9.0.1
>>>
>>>
>>> ..same result. I feel like there is some hidden config messing me up
>>>
>>> or some weird stuff happening. Anyone has an idea what it could be? Last 
>>> time I was
>>> still on F26 and it worked.
>>>
>> The last time I did anything with java the JAVA_HOME variable needed to be 
>> pointing
>> to the jre (java runtime engine) directory.
>>
>> Also, you should be using /usr/lib/jvm/java since your path will become 
>> invalid on
>> upgrades.
>>
>>
>>
>>
>> ___
>> users mailing list -- users@lists.fedoraproject.org
>> To unsubscribe send an email to users-le...@lists.fedoraproject.org
>

-- 
Fedora Users List - The place to go to speculate endlessly



signature.asc
Description: OpenPGP digital signature
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Mark C. Allman




On 11/26/2017 05:28 PM, cen wrote:
>
> Hm, there is no jre directory.
>
>
> On 11/26/2017 11:08 PM, Ed Greshko wrote:
>> On 11/27/17 05:43, cen wrote:
>>> Perhaps I am just going crazy but maven just won't pick up JAVA_HOME on F27.
>>>
>>> 1. sudo dnf install maven
>>>
>>> 2. echo $JAVA_HOME returns 
>>> /usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64
>>> (which includes bin dir with JDK tools such as javac, keytool etc so it is 
>>> JDK for
>>> sure)
>>>
>>> 3. Any mvn command results in
>>>
>>> The JAVA_HOME environment variable is not defined correctly
>>> This environment variable is needed to run this program
>>> NB: JAVA_HOME should point to a JDK not a JRE
>>>
>>>
>>> Also tried JDK8 and Oracel Java 9
>>>
>>> export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64
>>>
>>> export JAVA_HOME=/usr/java/jdk-9.0.1
>>>
>>>
>>> ..same result. I feel like there is some hidden config messing me up
>>>
>>> or some weird stuff happening. Anyone has an idea what it could be? Last 
>>> time I was
>>> still on F26 and it worked.
>>>
>> The last time I did anything with java the JAVA_HOME variable needed to be 
>> pointing
>> to the jre (java runtime engine) directory.
>>
>> Also, you should be using /usr/lib/jvm/java since your path will become 
>> invalid on
>> upgrades.
>>
>>
>>
>>
>> ___
>> users mailing list -- users@lists.fedoraproject.org
>> To unsubscribe send an email to users-le...@lists.fedoraproject.org
>
>
>
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org

I noticed the same thing today while reconciling a few config files with
their ".rpmnew" versions for packages updated via dnf.  I can't recall
which package it was though but I saw that "/usr/lib/jvm/jre" does't
exist ("/usr/lib/jvm/java" does).


*Mark C. Allman, PMP, CSM*
Founder, See How You Ski, www.seehowyouski.com 
Sr. Project Manager, Allman Professional Consulting, Inc.,
www.allmanpc.com 
617-947-4263, Twitter: @allmanpc
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread cen

To clarify, both are installed

export JAVA_HOME=/usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64
$JAVA_HOME/bin/java -version
openjdk version "9"
OpenJDK Runtime Environment (build 9+181)
OpenJDK 64-Bit Server VM (build 9+181, mixed mode)

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64
$JAVA_HOME/bin/java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)


Alternatives:
sudo update-alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
---
 + 1   java-9-openjdk.x86_64 
(/usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64/bin/java)
   2   java-1.8.0-openjdk.x86_64 
(/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre/bin/java)

*  3   /usr/java/jdk-9.0.1/bin/java

Enter to keep the current selection[+], or type selection number:


On 11/26/2017 11:31 PM, Ulf Volmer wrote:

On 11/26/2017 11:02 PM, Ulf Volmer wrote:

On 26.11.2017 23:23, cen wrote:


is java-1.8.0-openjdk-devel installed?

It is indeed.

then it should usually works out of the box. As Ed wrote, $JAVA_HOME
should point to the JRE. But in my case, there is no $JAVA_HOME defined,
maven uses the defaults from /etc/alternatives. So you can try to unset
JAVA_HOME.

[ulf@fc27-x1 ~]$ echo $JAVA_HOME

[ulf@fc27-x1 ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.12-300.fc27.x86_64", arch: "amd64",
family: "unix"

best regards
Ulf
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ulf Volmer
> On 11/26/2017 11:02 PM, Ulf Volmer wrote:
On 26.11.2017 23:23, cen wrote:

>> is java-1.8.0-openjdk-devel installed?

> It is indeed.

then it should usually works out of the box. As Ed wrote, $JAVA_HOME
should point to the JRE. But in my case, there is no $JAVA_HOME defined,
maven uses the defaults from /etc/alternatives. So you can try to unset
JAVA_HOME.

[ulf@fc27-x1 ~]$ echo $JAVA_HOME

[ulf@fc27-x1 ~]$ mvn -v
Apache Maven 3.5.0 (Red Hat 3.5.0-6)
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.13.12-300.fc27.x86_64", arch: "amd64",
family: "unix"

best regards
Ulf
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread cen

Hm, there is no jre directory.


On 11/26/2017 11:08 PM, Ed Greshko wrote:

On 11/27/17 05:43, cen wrote:

Perhaps I am just going crazy but maven just won't pick up JAVA_HOME on F27.

1. sudo dnf install maven

2. echo $JAVA_HOME returns /usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64
(which includes bin dir with JDK tools such as javac, keytool etc so it is JDK 
for
sure)

3. Any mvn command results in

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE


Also tried JDK8 and Oracel Java 9

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64

export JAVA_HOME=/usr/java/jdk-9.0.1


..same result. I feel like there is some hidden config messing me up

or some weird stuff happening. Anyone has an idea what it could be? Last time I 
was
still on F26 and it worked.


The last time I did anything with java the JAVA_HOME variable needed to be 
pointing
to the jre (java runtime engine) directory.

Also, you should be using /usr/lib/jvm/java since your path will become invalid 
on
upgrades.




___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread cen

It is indeed.


On 11/26/2017 11:02 PM, Ulf Volmer wrote:

On 26.11.2017 22:43, cen wrote:


1. sudo dnf install maven
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

is java-1.8.0-openjdk-devel installed?

best regards
Ulf
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ed Greshko
On 11/27/17 05:43, cen wrote:
> Perhaps I am just going crazy but maven just won't pick up JAVA_HOME on F27.
>
> 1. sudo dnf install maven
>
> 2. echo $JAVA_HOME returns /usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64
> (which includes bin dir with JDK tools such as javac, keytool etc so it is 
> JDK for
> sure)
>
> 3. Any mvn command results in
>
> The JAVA_HOME environment variable is not defined correctly
> This environment variable is needed to run this program
> NB: JAVA_HOME should point to a JDK not a JRE
>
>
> Also tried JDK8 and Oracel Java 9
>
> export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64
>
> export JAVA_HOME=/usr/java/jdk-9.0.1
>
>
> ..same result. I feel like there is some hidden config messing me up
>
> or some weird stuff happening. Anyone has an idea what it could be? Last time 
> I was
> still on F26 and it worked.
>

The last time I did anything with java the JAVA_HOME variable needed to be 
pointing
to the jre (java runtime engine) directory.

Also, you should be using /usr/lib/jvm/java since your path will become invalid 
on
upgrades.


-- 
Fedora Users List - The place to go to speculate endlessly



signature.asc
Description: OpenPGP digital signature
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Re: Maven won't pick up JAVA_HOME

2017-11-26 Thread Ulf Volmer
On 26.11.2017 22:43, cen wrote:

> 1. sudo dnf install maven

> The JAVA_HOME environment variable is not defined correctly
> This environment variable is needed to run this program
> NB: JAVA_HOME should point to a JDK not a JRE

is java-1.8.0-openjdk-devel installed?

best regards
Ulf
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org


Maven won't pick up JAVA_HOME

2017-11-26 Thread cen

Perhaps I am just going crazy but maven just won't pick up JAVA_HOME on F27.

1. sudo dnf install maven

2. echo $JAVA_HOME returns 
/usr/lib/jvm/java-9-openjdk-9.0.0.181-7.fc27.x86_64 (which includes bin 
dir with JDK tools such as javac, keytool etc so it is JDK for sure)


3. Any mvn command results in

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE


Also tried JDK8 and Oracel Java 9

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.fc27.x86_64

export JAVA_HOME=/usr/java/jdk-9.0.1


..same result. I feel like there is some hidden config messing me up

or some weird stuff happening. Anyone has an idea what it could be? Last 
time I was still on F26 and it worked.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org