Netbeans 10 not installing - java

I'm having issues trying to install NetBean 10 (incubating) on a laptop. I've checked that Java is installed, as well as JDK (jdk1.8.0_191). I've checked that Java is installed correctly by going to the command line and typing "java -version" and it correctly responds
java version "1.8.0_191"
Java(TM)SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
I've checked that the environment varible "JAVA_HOME" is correct (echo %JAVA_HOME%), and that the Path variable is correct.
However when I try installing NetBeans (from the C:\netbeans10\bin\netbeans64.exe) (yes, also double checked the laptop is correctly running Win10 64bit, it is) a logo for netbeans briefly appears, goes away after 1 sec, and nothing else happens.
I've tried downloading a fresh NetBeans, reinstalling Java, rebooting the system, disabled anti-virus, disabled firewall, tried from safe boot, however it just does not install.
Anyone have any ideas on what step I'm missing so that I can get this installed?
Thanks in advance.

A possible caused of your problem is that NetBeans is trying to run using a version of Java that does not exist on your machine. To eliminate this as a possibility:
Locate the file netbeans.conf. It will be in the etc directory within the NetBeans installation directory.
Open the file in any text editor. It is just a properties file containing name/value pairs,
Locate the line containing the text netbeans_jdkhome.
If the line is commented out delete the leading # character.
Set the value to the actual path to your JDK. For example, on my machine it would be: netbeans_jdkhome="C:\Java\jdk1.8.0_191".
Save the file and (re)start NetBeans. NetBeans will now use the JDK specified by the netbeans_jdkhome property.
If NetBeans still doesn't start then update your question with the content of the NetBeans log. See NetBeans - where to find the IDE log? for details on locating that file.
One other point: although you can run NetBeans 10.0 using JDK 8, I can't think of any good reason to do that. Most users will probably download and install JDK 11, and use that instead.

Related

Java not found error when loading Apache Netbeans 9.0 or 10

I downloaded the archive for the program, unzipped it to C drive on Windows, then when I try to run either executable (32bit/64bit) in the bin folder I get the error message:
Cannot find JAVA 1.8 or higher.
in spite of Java 10 (JRE) being already installed. I also tried Installing Java 9 but was stuck with the same message.
I appreciate your help with this, Thanks.
Locate your Netbeans installation and in it the etc/netbeans.conf file. Open it with any text editor, and locate the line containing netbeans_jdkhome. If it is commented out (line starts with #), then remove the # to enable the setting. Then, set the value to the path to your JDK. This might be somethiing like C:\Program Files\Java\jdk-10.0.1.
Try to run the program again, it should work now. At least, it did for me.
Also, ensure that you installed the Java Development Kit (JDK), not only the Java Runtime Environment (JRE). Netbeans needs the former to be installed in order to function.
I experienced the issue after I updated Java and the version changed but the netbean.conf had the older version which is invalid.
The remedy is go into that file via notepad, or any text editor and then update the path with the correct version number, i.e. netbeans_jdkhome="C:\Program Files\Java\jre1.8.0_311".
You would go determined your latest Java edition, by pulling up the Java control panel and then hit the middle "Java" tab, hit "View" to see the current version you have installed.
This is the issue of compatibility of Netbeans with your installed jdk version
Locate your etc/netbeans.conf file and Open it. In the #netbeans_jdkhome="C:\Program Files\Java\jdk-17.0.1" replace the given path with your installed jdk. It will work

Ecilpse Oxygen.3a Java IDE cannot add window GUI via window builder error opening wizard

I try to use the Eclipse Oxygen v4.7.3a (Oxygen) Java IDE.
I try to use window builder to build a GUI application with Java, but when I try to add the window I have an error message.
I tried to google it, but I cannot even know what that message needs from me.
It says:
problem opening wizard
The selected wizard could not be started.
Plug-in org.eclipse.wb.swing was unable to load class org.eclipse.wb.internal.swing.wizards.application.NewSwingApplicationWizard.
An error occurred while automatically activating bundle org.eclipse.wb.core.java (528).
My java -version output:
OpenJDK version "10" 2018-03-20
OpenJDK Runtime Environment (build 10+46-Ubuntu-5ubuntu1)
OpenJDK 64-Bit Server VM (build 10+46-Ubuntu-5ubuntu1, mixed mode)
I had exactly the same error occur in Eclipse Oxygen.3a on my Mac with Java JDK 10 installed. There is code in WindowBuilder 1.9 that uses a Java feature that was either altered or dropped in Java 10. I was able to resolve the problem by making two changes (they assume that a Java 9 JDK is available on your system; if not, you must install it):
change the Java VM for Eclipse to one in a Java 9 JDK (using the -vm setting in eclipse.ini; see this link for a good post on how to do that)
change the JRE for the project to a Java 9 JRE
The first change is the more important one since Window Builder is a development aid running as part of Eclipse.
I made the project JRE change for my own sanity so I didn't have a mix of Java versions. You may be able to skip that change (I didn't try it).
I still have Java 10 as the default for the system, so you don't have to completely fall back to Java 9 if you install both JDKs. It may take some tweaking to get both Java 9 and 10 installed and have the one you prefer working as the system default.

Cannot set up SDK for IntelliJ Idea

I am beginner in linux (running Linux Mint 18.3), and trying to set-up my environment for Java development. I've done this several times on my Windows machine, and it always worked, but couldn't make it work for linux.
Running command java-version returns the following:
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
Still, when I open IntelliJ, it says that Project SDK is not defined. When I am trying to set it up to the folder /usr/lib/jvm/java-8-openjdk-amd64/jre/bin (being the location I found digging into my filesystem starting with command whereis java) it says that "The selected directory is not a valid home for JDK". I've added manually the path also to $JAVA_HOME and '$PATH' but the problem persists.
The path you posted says "jre" in it, you need the JDK.
You need shoose JDK path
without BIN folder, like D:\java\jdk\jdk1.8.0_162

Eclipse in OS X uses different version of Java than CLI

When I type java -version in the console I get java version "1.8.0_05". The soft link /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK points to /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents. In the java preferences window, the only listed version of Java is 1.8. JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home.
However, when I try to run Eclipse.app, I get the error: Version 1.6.0_65 of the JVM is not suitable for this product. Version: 1.7 or greater required.
I believe it is trying to use /System/Library/Java/JavaVirtualMachines and in that directory the only version is 1.6.0.jdk.
How can I get eclipse to use the correct version of Java?
I solved this issue in my mac with yosemite:
Installed JDK for MACOSX 64bits from https://jdk8.java.net/download.html
Inside the eclipse.ini I put this line:
-vm /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
And it worked for me!
Download the 64-bit version of Eclipse instead of the 32-bit version.
The reason is that Eclipse contains native machine code (for the GUI) which is why there is both a 32-bit and 64-bit version of Eclipse, and this explicitly require the corresponding Java version. Originally Apple created both versions up to Java 6, but Oracle only creates a 64-bit version (much to the dismay of owners of older machines). So, if you download a 32-bit version of Eclipse it will only run with an Apple JVM, which apparently is too old (which surprise me - I thought Java 6 was still supported for Eclipse 4.4)
I faced this same problem but rather than making it to use version 1.8 I changed the settings in eclipse.ini file so I can just run the program regardless which version of jvm does it want to use
Solution:
Open the directory where you have Eclipse copy in your computer.
You would see a file name eclipse press control key and click on it to see the options.
Then click on Show Originalfrom the options, there you would find eclipse.ini file open it with a text editor and change the -Dosgi.requiredJavaVersion=1.7 to -Dosgi.requiredJavaVersion=1.6
Save the file and open the ecplise.app it should open now without any error
Try adding the following lines to your eclipse.ini:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
Maybe a newer version of eclipse could help, too (if yours is out of date).
Take a look in your System Preferences -> Java. It should open the Java Control Panel. In the panel, check if you have one (or many) JDKs.
I suspect you have many and are setting the JDK in your .profile while Eclipse is reading some other Java Home.
You can change them manually by running this in your terminal
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
To check if it worked, run java -version and you should see something like
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
Try calling Eclipse now from the command line. To call Eclipse as an App, just set the Java8 through the Java Control Panel. This will be read when Eclipse starts.
This is what I have on my Java Control Panel:
This is on my Eclipse Luna:
Download the 64-bit version of Eclipse.
This solved the problem. Thanks everyone.

Switch between 32-bit and 64-bit JDK platform on Windows 7

I am using Windows 7 on my laptop. I am working with jpcap libraries which work only on 32-bit JDK. Having both 32 and 64 bit JDKs installed on my machine. How can I switch between 64-bit and 32-bit JDK?
I tried changing the %JAVAHOME% and %PATH% environment variables, but it didn't work. Should I change anything in the registry?
#Srikant Sahay, Thank you very much! It did work on widnows 8.1 64 bit OS.
I am able to Switch between 32-bit and 64-bit JDK platform on Windows 8.1 on demand. The trick, as Srikant suggested, is to set the path before all other path variables. Make sure you put fist in the path variable.
java -d32 -version ( or simply )
java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
However, only one instance works at a time. Either you choose the 32 bit version or the 64 bit version. So, if you type "java -d64 -version" you will get
Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.
Therefore, if you instead want a 64bit JVM you should put the JDk installation folder(in my case "C:\Program Files\Java\jdk1.7.0_51\bin" since the OS is 64 bit by default) first in the path variable.
cheers!
You can either set your path, or switch between JDK's in your IDE. Personally I use JetBrains IntelliJ IDEA and set the JDK via the IDE.
Setting via IDE:
From within a project:
click File -> Project Structure
Select Project under Project Settings
Select the Project SDK. If yours is not listed, click New -> JDK and browse for the JDK
From a new project:
Click File -> New Project
Select the Project SDK. If yours is not listed, click New -> JDK and browse for the JDK
If you want to set your path:
Follow the directions listed on the java.com site.
Keep in mind that your jar will run using whatever version of java is specified in your PATH.
If your PATH variable is not working, try cleaning up your path variable by removing unnecessary entries and rebooting. After reboot add Java to the path and reboot again.
If your still having issues, try executing using the absolute path of the java version your trying to use to ensure it works. If it does work, check your path variable against it to ensure it is accurate.
No, don't touch the registry. Each running Java application gets a single unique JVM instance. So a single java program cannot run some parts of the code in one JVM and other parts of the code in another JVM, as far as I know. You can, however, choose which JRE a particular java program runs in, so you can run the entire jpcap program in your 32 bit java version. Use a startup script (batch file) that points to the exact location of java.exe. When you run "java MyClassName" it's really just finding the java executable on the PATH environment variable, so by explicitly specifying your path, you get to choose your version. In other words, if you run a java program using "java MyClassName" (or if a program on your machine does so) it will use the java.exe application found on your PATH environment variable. Applications themselves can use whatever environment variables they choose: typically the ones used for java are JAVA_HOME and JRE_HOME. So you might want to try setting both of those and then trying to run your program again.
Set the path of your java in System Environment Variables PATH variable. Set it to be before any other path (even System 32 if java or javaw is present there).

Categories