NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

specifying the JDK version for a Maven app to run under?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Stephen Winnall
Posted via mailing list.





PostPosted: Fri Jun 19, 2009 5:52 pm    Post subject: specifying the JDK version for a Maven app to run under? Reply with quote

I've spent all afternoon trying to Google an answer to this, but my
brain hasn't come up with the right search terms :-)

I have a Java application which is built with Maven 2. The application
includes a 32 bit native library. I work on Mac OS X 10.5.7 using
NetBeans 6.5.

This week I installed the latest Java update from Apple and NetBeans
wouldn't create new classes etc. (as mentioned in other posts) so I
told NetBeans to run under JDK 1.6, which it now does. Unfortunately,
JDK 1.6 on the Mac is only 64 bit, and NetBeans now starts Maven with
JDK 1.6, which means that when I try to run my application, JDK 1.6 is
used. This obviously has disastrous consequences when I get to the bit
where my 32 bit native library is called.

All my POMs contain source=1.5 and target=1.5, but this has no effect
on the JDK/JRE used when executing the app. My Java preferences and my
JAVA_HOME all point to JDK 1.5, which runs in 32 bit mode, but
NetBeans overrides this when calling Maven.

Can anyone tell me how to get NetBeans to tell Maven (or the app) to
run under JDK 1.5?

Steve
Back to top
mkleint
Posted via mailing list.





PostPosted: Fri Jun 19, 2009 7:37 pm    Post subject: specifying the JDK version for a Maven app to run under? Reply with quote

Stephen Winnall wrote:
Quote:
I've spent all afternoon trying to Google an answer to this, but my
brain hasn't come up with the right search terms :-)

I have a Java application which is built with Maven 2. The application
includes a 32 bit native library. I work on Mac OS X 10.5.7 using
NetBeans 6.5.

This week I installed the latest Java update from Apple and NetBeans
wouldn't create new classes etc. (as mentioned in other posts) so I
told NetBeans to run under JDK 1.6, which it now does. Unfortunately,
JDK 1.6 on the Mac is only 64 bit, and NetBeans now starts Maven with
JDK 1.6, which means that when I try to run my application, JDK 1.6 is
used. This obviously has disastrous consequences when I get to the bit
where my 32 bit native library is called.

All my POMs contain source=1.5 and target=1.5, but this has no effect
on the JDK/JRE used when executing the app. My Java preferences and my
JAVA_HOME all point to JDK 1.5, which runs in 32 bit mode, but
NetBeans overrides this when calling Maven.

in 6.7 you can set the JDK to be used by the maven build (among other
things) in the Build/Compile panel in the project properties dialog.
in 6.5 you can (if I recall correctly) set the Env.JAVA_HOME property in
the Actions panel in project properties for the Run/Debug project action
mapping.

There might be more cards in the game as Mac has a weird way of defining
env variables. The programs executed from UI get different set than
program run from command line..

Milos

Quote:
Can anyone tell me how to get NetBeans to tell Maven (or the app) to
run under JDK 1.5?

Steve
Back to top
Stephen Winnall
Posted via mailing list.





PostPosted: Fri Jun 19, 2009 8:15 pm    Post subject: specifying the JDK version for a Maven app to run under? Reply with quote

On 19 Jun 2009, at 21:37, mkleint wrote:
Quote:
Stephen Winnall wrote:
Quote:
I've spent all afternoon trying to Google an answer to this, but my brain hasn't come up with the right search terms Smile

I have a Java application which is built with Maven 2. The application includes a 32 bit native library. I work on Mac OS X 10.5.7 using NetBeans 6.5.

This week I installed the latest Java update from Apple and NetBeans wouldn't create new classes etc. (as mentioned in other posts) so I told NetBeans to run under JDK 1.6, which it now does. Unfortunately, JDK 1.6 on the Mac is only 64 bit, and NetBeans now starts Maven with JDK 1.6, which means that when I try to run my application, JDK 1.6 is used. This obviously has disastrous consequences when I get to the bit where my 32 bit native library is called.

All my POMs contain source=1.5 and target=1.5, but this has no effect on the JDK/JRE used when executing the app. My Java preferences and my JAVA_HOME all point to JDK 1.5, which runs in 32 bit mode, but NetBeans overrides this when calling Maven.

in 6.7 you can set the JDK to be used by the maven build (among other things) in the Build/Compile panel in the project properties dialog.
in 6.5 you can (if I recall correctly) set the Env.JAVA_HOME property in the Actions panel in project properties for the Run/Debug project action mapping.

There might be more cards in the game as Mac has a weird way of defining env variables. The programs executed from UI get different set than program run from command line..

Milos





Thanks, Milos. The 6.7 way works for me, and it's probably about time for me to upgrade anyway.


Steve
Back to top
mr13stu



Joined: 15 Dec 2009
Posts: 3

PostPosted: Wed Dec 16, 2009 4:05 pm    Post subject: Reply with quote

I'd love to upgrade, but our apps run on IBM websphere and the plug-in for WAS is busted after 6.5.1
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo