NetBeans Forums

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

Run NetBeans with JDK6, compile and run JavaEE app with JDK1.7

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





PostPosted: Sat Jun 30, 2012 12:27 am    Post subject: Run NetBeans with JDK6, compile and run JavaEE app with JDK1.7 Reply with quote

I've using NetBeans 7.1.2 with JDK7u5 on MacOS X from some time, and
as Mac users may have noticed, Apple's JDK has a overall better
integration with the OS than Oracle's JDK7 for OSX. What I'm trying to
accomplish is to run NetBeans with Apple's JDK6 and compile and run a
JavaEE app with Oracle's JDK7. I got this so far:

- Edit netbeans.conf and specify Apple's JDK6 as default jdk. Now
NetBeans gets launched with JDK6.
- In Tools -> Java Platforms added Oracle's JDK7 as a Java platform.
Now I have JDK 1.6 (Default) and JDK 1.7
- Created a new JavaEE6 app. In every project's properties (-ejb &
-war) I changed java plaform and source level to JDK 1.7
- Created a test JSF page with Java7 features, like diamond operators
and switch with string.

So far it's works fine, Java7 features are recognized. The problem
is when I try to run the application, Glassfish cames out with this
error:

"Error while trying to load Bean Class
com.icontech.jdk7test.indexBean :
java.lang.UnsupportedClassVersionError: WEB9032: Class
com.icontech.jdk7test.indexBean has unsupported major or minor version
numbers, which are greater than those found in the Java Runtime
Environment version 1.6.0_33"

wich oviously means that I need Glassfish to be started with JDK7.
I went to Glassfish server properties, and selected Oracle's java
executable but the server does not start:

"Error: This Java instance does not support a 32-bit JVM.
Please install the desired version."

Oracle
Back to top
SearchEngine27



Joined: 21 Jun 2012
Posts: 66

PostPosted: Mon Jul 02, 2012 1:50 pm    Post subject: Reply with quote

well for starters, you always need to compile and run a project with the same version. Which you fixed by changing what version glassfish used

besides that, glassfish gave you your error. it seems you installed 32-bit java7
Back to top
Antonio Varela
Posted via mailing list.





PostPosted: Tue Jul 03, 2012 8:29 am    Post subject: Run NetBeans with JDK6, compile and run JavaEE app with JDK1.7 Reply with quote

On Mon, Jul 2, 2012 at 6:50 AM, SearchEngine27 <address-removed> wrote:
Quote:
well for starters, you always need to compile and run a project with the same version. Which you fixed by changing what version glassfish used

besides that, glassfish gave you your error. it seems you installed 32-bit java7


Thanks for answering. I'm using Glassfish 3.1.2, but not a 32-bit
JVM; and that's the issue indeed. A 32-Bit JVM is not supported for
jdk7u5 in Mac OSX, and the system it's trying to launch Glassfish with
it.

--
Antonio Varela
address-removed
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