I have netBeans 7.4 with openJDK 7 running on Ubuntu 14.04 x64 System.
I want to change the default "Source/Binary format" in java project setting to JDK 6 (I DO NOT WANT TO INSTALL OpenJDK 6 because I have openJDK 7 which is compatable).
Also in C++ Project, I want to change the default "Console Type" in the "Run" section of project settings from "Internal" which causes some problems to "Standard Output".
From the NetBeans doc:
Note: If a compatible JDK installation cannot be found, you might need to manually add a path to the JDK installation directory by doing the following:
Open the netbeans.conf file located in the netbeans/etc directory in a text editor.
Enter the location of a compatible JDK installation for the netbeans_jdkhome option. The default location in Windows is C:\Program Files\Java\jdk1.7.0_67 or similar.
Save the netbeans.conf file and run the executable file in the netbeans/bin directory.
https://netbeans.org/community/releases/80/install.html
Find the spot that needs changing by ctl-F JDK and tab down until you see where it is specifying the path. Hopefully your new JDK is located in the same folder and you only have to change the version number.
You should save a copy of the conf file as confold or something in case something goes wrong.
Related
JDK 1.8 is already installed in Windows 10 64 bit system. I am trying to create a scala project in Eclipse Scala IDE. Is says "Unbound classpath container: JRE System Library [JavaSE-1.8] in project.
While checking the Java build path-- Libraries-- JRE is coming outbound.
When I click to add JRE library, it has workspace default JRE (unbound)
While searching through preferences-- installed JRE--search. It gives no JREs.
If I try to add -- standard vm--directory ( JDK dir home). Ideally it should populate or detect all the jars but it doesn't detect.
I Tried running the application as 'Administrator' and it ran successfully.
Select your project and right click--> Build Path --> Configure Build Path -->Select Libraries--> Add Library-->JRE System Library--> Add the installed JRE here.
And if the JRE library is not getting selected, check the environment variables- JAVA_HOME and Path.
And to see if the java is correctly installed, try hitting this from CMD
java -version
Netbeans would not find compatible jdk while installation while JDKs are located at C:Java and the files are:
jdk-8u73-windows-i586
jdk-8u73-windows-x64
jdk-8u141-windows-i586
From NetBeans Installation Instructions
The default location in Windows is C:\Program Files\Java\jdk1.7.0_10 or similar.
If your JDK is at C:\Java you just have to:
re-install the JDK under the default Netbeans location, or
specify your custom location during the installation wizard
Since I've run into this problem and this Q/A came up in my search, here is the solution that I found worked for me on the Windows platform.
I had to set up an system environmental variable named JAVA_HOME that pointed to the JDK directory.
JAVA_HOME=D:\Program Files\Java\jdk1.8.0_144
Even after this change, I still ran into the "An unknown error occured while validating path."
Right-click on the NetBeans install software and select "Run as Administrator...". It looks like running the installer under your normal account, even though it may have admin rights, is not enough to scan the "\Program Files" folder and find the JDK.
*Delete your old java files.
*Download jdk file from.
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
*install new jdk version.
*Then install NetBeans //Now it will automatically identify your jdk and no need for manual selection...
I have a jdk1.8.0_92 installed, which is also added to the Java/Installed JREs in Eclipse Neon. The "bin" subfolder containing the java compiler and all other components of a standard JDK is there. Still, when I try to assign this JRE as a "Server Runtime Environment" of a GlassFish server, Eclipse complains it needs a JDK and not a JRE. An older jdk1.7.0_55 folder does not produce this problem, it is considered to be a JDK by Eclipse, and not a JRE. What may be missing from the 1.8 installation, by which Eclipse categorizes it as a JRE? Image of the error message :
Okey, check this
glassfish\config\asenv.bat
where java path is configured
REM set AS_JAVA=C:\Program Files\Java\jdk1.8.0_92\jre/..
set AS_JAVA=C:\Program Files\Java\jdk1.8.0_92
Is it possible to get Java in zip format? I don't want to install it by getting .exe file.
Is there any zip version of Java 1.8 so that I can download it and extract it and start using it in my Windows machine (64-bit processor)?
You can extract the JDK folder from the Installation EXE.
Check this link for the steps. The post was for JDK 1.7 it will work for JDK 1.8 also
Do the following.
Steps
Download JDK from Oracle
Download and Install 7-zip from here
Open installition exe using 7-Zip
Extract the tools.zip
Extract the content of tools.zip to a folder (e.g. c:\jdk).
Open the extracted folder in cmd prompt.
Execute for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" command
Set JAVA_HOME to the jdk (e.g c:\jdk) folder.
Add %JAVA_HOME%/bin to the PATH env variable.
Testing
Run the following command to check the installation, it will print the version of JDK.
c:> javac -version
javac 1.7.0_51
NOTE: Tested with JDK 1.7 and 1.8
Update 1
Edited the answer to add the steps in the answer itself instead of the link to a blog post.
Update 2
For 64-Bit please check unpack-jdk-x64.bat by grabantot
I was looking for a solution to this as well. I'm not sure why the OP wanted to do this. I'm just trying to get a newer version of java for new development while not interfering with an older Java install which a legacy application requires (I'd like to update the legacy app, but it's not an option, now)
I think the hack I am going to try is this:
Install 1.8
Take a copy of the install folder
Uninstall 1.8
Reinstall / Repair 1.7
restore the copy of 1.
I'm sure if I had a better understanding of what the install is doing, this would not be necessary.
I had a spare virtual machine hanging around (if not you could build one or maybe even download one) so I:
installed the Oracle JDK in the guest
copied the jdk folder from the guest to the host
added a JAVA_HOME environment variable.
The operating systems obviously have to be close (not sure how close, I used Windows Server 2008 64 bit guest on a Windows 10 64 bit host and it seemed to work).
Was a quick fix for me as I didn't want a full install and wanted to remove it afterwards.
If you do not have permission to unzip zip file then you cannot install java .
As java does not need installation for running . You just need to give path of java.exe where it is located .
In Windows it is located in C:\Program Files\Java\jdk1.8.0_05\bin
For a solution you can run installer on any machine that you have permission and just copy and paste the folder of java to anywhere in your system (Machine where you have administrative rights problem) . and just set the path as by opening command prompt as set path="C:\Program Files\Java\jdk1.8.0_05\bin"
java will be working as you want
The following worked for me (I had JDK 1.8 installed and needed the 32 bit version as well):
Verify the current version with java -version
Assuming a different version (minor or major is being installed), download the relevant JDK installable from Oracle and run it. In the
first dialog, specify a different folder than the default location
(might work with the default one as well), then select Next. It will
extract the files there in this folder, then it will asl for the
folder where the JRE is to be installed. Simply close the installer,
now you should have just the JDK in the specified folder.
Rerun java -version, it should give you the same version as earlier.
Worst case, if it shows the newer version, go to your system path (Right click My Computer (or This PC) -> Properties -> Advanced
system settings -> Advanced tab -> click on Environment variables
button) and remove the Oracle javapath entry (From the Path variable
in the bottom part of the window). The add the older java version's
bin folder to the path variable in the beginning.
for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"
Is this working for linux shell scripting , I got syntax error for the above.
I am using Netbeans 6.7. I had first installed Java 1.5 before installing Netbeans. When i installed Netbeans it took Java 1.5 as the default version. Then i installed Java 1.6 on my machine. I need to change the default JDK of my netbeans to 1.6 not only to a specific project but to the whole Netbeans application.
You can change the JDK for Netbeans by modifying the config file:
Open netbeans.conf file available under etc folder inside the NetBeans installation.
Modify the netbeans_jdkhome variable to point to new JDK path, and then
Restart your Netbeans.
In my Windows 7 box I found netbeans.conf in <Drive>:\<Program Files folder>\<NetBeans installation folder>\etc . Thanks all.
For anyone on Mac OS X, you can find netbeans.conf here:
/Applications/NetBeans/NetBeans <version>.app/Contents/Resources/NetBeans/etc/netbeans.conf
In case anyone needs to know :)
open etc folder in netbeans folder then edit the netbeans.conf with notepad and you will find a line like this :
Default location of JDK, can be
overridden by using --jdkhome
:
netbeans_jdkhome="G:\Program
Files\Java\jdk1.6.0_13"
here you can set your jdk version.
on Fedora it is currently impossible to set a new jdk-HOME to some sdk. They designed it such that it will always break. Try --jdkhome [whatever] but in all likelihood it will break and show some cryptic nonsensical error message as usual.
Fix this by moving my jdk folder to other disk
Either change the jdk home in the application preferences or look for the application's config files.
On Mac OS X, its in a netbeans.conf file, and look for the jdk home value.
here: