Netbeans: JVM Creation fails after changing default JDK - java

I have installed Netbeans 7.1 and its default JDK is version 1.6. Since I want to change it to version 1.7, I changed the following code in etc/netbeans.conf file
netbeans_jdkhome="C:\Program Files (x86)\Java\jdk1.6.0_06"
to
netbeans_jdkhome="C:\Program Files (x86)\Java\jdk1.7.0"
since JDK 1.7 file name is jdk1.7.0
After changing the file path when I reopen Netbeans, an error message will print as "JVM Creation failed". So I changed the file path back to the previous one and Netbeans started without giving an error message.
How can I change the default JDK version of Netbeans to 1.7?

Right click on the project, go to properties, go to libraries option, click on the manage platforms button, if you don't have Java 7 add it or else select the platform.

Related

How do I stop NetBeans from "popping up "invalid jdkhome specified" window

I previously had JDK 9 installed. Because of the issue NetBeans has with JDK 9, I deleted JDK 9 from my computer and installed JDK 8.
Now, Netbeans doesn't have any issue anymore, except that it pops up this window whenever I open NetBeans. If I click yes on window, everything works fine. It just bothers me I have to click it every time I open NetBeans.
As the link in the OP comment points out, the cause of the problem is almost certainly an invalid value for netbeans_jdkhome in file netbeans.conf:
netbeans_jdkhome="C:\Java\jdk1.8.0_161"
Make sure that the string value references a valid JDK8 installation. (File netbeans.conf resides in the etc directory directory directly under the NetBeans installation directory.)
However, there are also a couple of other configuration settings worth checking:
Select Tools > Java Platforms and verify that the Platform Folder is valid:
Select Tools > NetBeans Platforms and verify that the Platform Folder is valid:
As a related issue, although NetBeans 8.x does not support Java 9, you can download a beta version of Apache's NetBeans 9, which supports both Java 9 and Java 10, from the Apache NetBeans site. Note that:
Installing NetBeans 9 has no impact on your NetBeans 8.x installation.
You can safely run NetBeans 8.x and NetBeans 9 concurrently.
Update:
Try the following if you get an "access denied" error when updating netbeans.conf on Windows:
Close NetBeans, then open netbeans.conf in Notepad.
Make your changes and then save the file to any temporary location such as C:\temp.
In Windows File Explorer move that file you just created to the NetBeans 8.x target directory (e.g. C:\Program Files\NetBeans\etc) to overwrite the existing version of netbeans.conf.
Restart NetBeans.

How to change Java JVM for JBoss?

I did an installation on my Mac of a new Java SDK (1.6 -> 1.7).
On command line it shows the 1.7. And I even changed the Mac's Symlink of CurrentJDK.
But JBoss still shows me a path entry "java.home" pointing to 1.6. And it is not possible to change that via admin website.
Anybody know how to change that?
PS: I start JBoss from Eclipse, which knows also 1.7 now as default.
Open the Launch Configuration for your JBoss server in Eclipse. On the JRE tab you can select the specific Java runtime that it will run in. If the option Project Execution Environment is selected (the default), then you can change it by opening the Project properties, going to the Java Build Path section, then the Libraries tab. Select the JRE System Library entry from the Libraries list then use the **Edit...* button to select your desired Execution Environment.

JRE version of my computer

I have two jre in my PC which is running windows 7. When I am running a eclipse project I dont know which version of jre it is calling, so I searched on net for the solution and tried this two things:
In cmd typed java --version and it showed me 1.6.
In control panel, I went it in java control panel and selected java and it showed me 1.7 enabled.
Now, I am confused and how can I change the jre of the system? I want my eclipse project which is running on tomcat to use a specific jre. But I dont know which jre my system is using.
Thanks in advance.
You may check Windows->Preferences->Java->installed to check default JRE that it runs things under.
You may also check property eclipse.vm under the Help->About Eclipse->Installation Details->Configuration.
choose window preferences in eclipse. Select installed jre and add a jre and select an jre you are going to use.
java -version is what a java app on the system will use by default. What IE uses is determined by the extension (Tools->Manage add-ons) you can see the java plugin there.
You can register any jre vesion you want in eclipse using the window->preferences-> installed JRE's
If you are using eclipse, you can set the Java version by going to project->properties->java build path->select the jre version and click on edit.
You can choose the version that you want. Whichever JRE library is displayed in the build path is the version that eclipse is using to compile your code.

How do I upgrade Java Compiler?

I'm using JCreator to work with Java. I got this exception (or maybe error?) it says the following:
major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
I downloaded the last version of Java SE, but that didn't work.
By the way, Java files compile fine and also run without any problem. But I have downloaded a file that my instructor has upload with many java classes and this message appears when I try to run the class that has the main method.
I've never used JCreator, but a little bit of Googling gave me this page of JCreator installation instructions, which has the following instructions for manually setting the JDK that JCreator uses:
Starting JCreator Without Using the Setup Wizard
With JCreator active, open the Options window from the Configure menu.
Click the JDK Profiles option.
Click the default item in the list, and click Edit.
Ensure that the Name field shows the correct version of the selected JDK directory; in this case, JDK version jdk1.6.0. [ That's a typo I think ... ]
Set the JDK Home path by clicking the Browse button next to this field.
Browse to the root directory of the JDK installation: C:..\jdk1.7.0. Click OK.
Click the Documentation tab, and Add the path: C:..\jdk1.7.0\docs. Click OK.
Close the windows.
Yours is a slightly different scenario, but I think these instructions should also work for changing the JDK for an existing installation of JCreator.
(Use the pathnames of your latest JDK installation ... obviously.)

Eclipse - Just uninstalled Java 1.7 (still have Java 1.6 on my machine), but now Eclipse won't recognize any java stuff

I'm extremely confused about how to set up Java on Eclipse. I don't get how classpath/system variables/etc all works. I set my Java compiler settings from 1.7 to 1.6 after I uninstalled 1.7 (I still have 1.6). But it's still not working. Any help?
Open Eclipse. Follow Project => Properties => Java Build Path.
Come onto Libraries tab and on the right hand side you will see some buttons, click Add Library.
Select JRE System Library and click "Next" button. By clicking on Installed JREs button you will see the JREs that your Eclipse recognizes. If the JRE version is not visible there, you can use "Add" button to add a new JRE, and make sure you set the path of new JRE correctly. Sample path on my machine: C:\Program Files (x86)\Java\jre6
Probably you have to set up classpath: http://javarevisited.blogspot.com/2011/01/how-classpath-work-in-java.html, or may be you have only JRE (not JDK)?

Categories

Resources