Discussion:
Netbeans question?
(too old to reply)
Knute Johnson
2013-02-21 00:22:02 UTC
Permalink
I'm trying to learn how to use Netbeans but that isn't really my
question. When I start it I get a dialog that says "Invalid jdkhome",
"Cannot locate Java installation", "C:/...1.7.0_10", "Do you want to try
to use the default version?" If I press the NO button it just quits, if
I press the Yes button it starts and works normally. I can't find any
place in the program to change the "jdkhome". It finds the current
1.7.0_15 installation without any difficulty. Anybody know how to reset
this?

Thanks,

knute...
John B. Matthews
2013-02-21 02:32:21 UTC
Permalink
Post by Knute Johnson
I'm trying to learn how to use Netbeans but that isn't really my
question. When I start it I get a dialog that says "Invalid
jdkhome", "Cannot locate Java installation", "C:/...1.7.0_10", "Do
you want to try to use the default version?" If I press the NO
button it just quits, if I press the Yes button it starts and works
normally. I can't find any place in the program to change the
"jdkhome". It finds the current 1.7.0_15 installation without any
difficulty. Anybody know how to reset this?
Look in Tools > Java Platforms; there should be an Add Platform button.
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Eric Sosman
2013-02-21 03:15:32 UTC
Permalink
Post by Knute Johnson
I'm trying to learn how to use Netbeans but that isn't really my
question. When I start it I get a dialog that says "Invalid jdkhome",
"Cannot locate Java installation", "C:/...1.7.0_10", "Do you want to try
to use the default version?" If I press the NO button it just quits, if
I press the Yes button it starts and works normally. I can't find any
place in the program to change the "jdkhome". It finds the current
1.7.0_15 installation without any difficulty. Anybody know how to reset
this?
I've seen this after installing a JDK update when NetBeans
is already present. (Guess: The NetBeans installer sniffs out
an existing JDK, but the JDK installer doesn't detect and update
an existing NetBeans.) What works for me is to edit the file

C:\Program Files\NetBeans<version>\etc\netbeans.conf

... and change the "netbeans_jdkhome=" line to point to my
updated JDK.

(Um, er, you *do* have a JDK installed, right?)
--
Eric Sosman
***@comcast-dot-net.invalid
Knute Johnson
2013-02-21 03:25:34 UTC
Permalink
Post by Eric Sosman
Post by Knute Johnson
I'm trying to learn how to use Netbeans but that isn't really my
question. When I start it I get a dialog that says "Invalid jdkhome",
"Cannot locate Java installation", "C:/...1.7.0_10", "Do you want to try
to use the default version?" If I press the NO button it just quits, if
I press the Yes button it starts and works normally. I can't find any
place in the program to change the "jdkhome". It finds the current
1.7.0_15 installation without any difficulty. Anybody know how to reset
this?
I've seen this after installing a JDK update when NetBeans
is already present. (Guess: The NetBeans installer sniffs out
an existing JDK, but the JDK installer doesn't detect and update
an existing NetBeans.) What works for me is to edit the file
C:\Program Files\NetBeans<version>\etc\netbeans.conf
... and change the "netbeans_jdkhome=" line to point to my
updated JDK.
(Um, er, you *do* have a JDK installed, right?)
I do :-)

I found the .conf file too and that does fix the dialog problem.

I followed John's advice (hint maybe) and added the existing Java to the
platforms. I discovered that the Default java installation does not
have JavaFX for some reason but one can install the same java
installation again (makes no sense to me). But you can't delete the
Default(?)

Thanks Eric and John

knute...
Roedy Green
2013-02-21 06:25:45 UTC
Permalink
On Wed, 20 Feb 2013 19:25:34 -0800, Knute Johnson
Post by Knute Johnson
I found the .conf file too and that does fix the dialog problem.
you are supposed to have a:

SET JAVA_HOME=E:\Program Files\java\jdk1.7.0_15

Perhaps it would have used that.
--
Roedy Green Canadian Mind Products http://mindprod.com
The generation of random numbers is too important to be left to chance.
~ Robert R. Coveyou (born: 1915 died: 1996-02-19 at age: 80)
Knute Johnson
2013-02-21 15:45:56 UTC
Permalink
Post by Roedy Green
On Wed, 20 Feb 2013 19:25:34 -0800, Knute Johnson
Post by Knute Johnson
I found the .conf file too and that does fix the dialog problem.
SET JAVA_HOME=E:\Program Files\java\jdk1.7.0_15
Perhaps it would have used that.
What program uses JAVA_HOME?

knute...
Roedy Green
2013-02-21 23:24:05 UTC
Permalink
On Thu, 21 Feb 2013 07:45:56 -0800, Knute Johnson
Post by Knute Johnson
What program uses JAVA_HOME?
gcc, ant
--
Roedy Green Canadian Mind Products http://mindprod.com
The generation of random numbers is too important to be left to chance.
~ Robert R. Coveyou (born: 1915 died: 1996-02-19 at age: 80)
Lew
2013-02-22 02:34:12 UTC
Permalink
Post by Knute Johnson
Post by Roedy Green
Post by Knute Johnson
I found the .conf file too and that does fix the dialog problem.
SET JAVA_HOME=E:\Program Files\java\jdk1.7.0_15
Perhaps it would have used that.
What program uses JAVA_HOME?
Seriously?

A zillion of them. It's the convention.

http://lmgtfy.com/?q=what+program+uses+JAVA_HOME
--
Lew
Knute Johnson
2013-02-22 22:31:33 UTC
Permalink
Post by Lew
Post by Knute Johnson
Post by Roedy Green
Post by Knute Johnson
I found the .conf file too and that does fix the dialog problem.
SET JAVA_HOME=E:\Program Files\java\jdk1.7.0_15
Perhaps it would have used that.
What program uses JAVA_HOME?
Seriously?
A zillion of them. It's the convention.
http://lmgtfy.com/?q=what+program+uses+JAVA_HOME
I do most of my development on Windows and it certainly isn't required
to make the compiler or runtime function there. I'm pretty sure I've
never set it on my Linux box either. From the link you posted I see
that ant uses it but I don't see anything else except Glassfish.

knute...
Lew
2013-02-22 23:25:53 UTC
Permalink
Post by Knute Johnson
Post by Lew
Post by Knute Johnson
What program uses JAVA_HOME?
Seriously?
A zillion of them. It's the convention.
http://lmgtfy.com/?q=what+program+uses+JAVA_HOME
I do most of my development on Windows and it certainly isn't required
to make the compiler or runtime function there. I'm pretty sure I've
never set it on my Linux box either. From the link you posted I see
that ant uses it but I don't see anything else except Glassfish.
That search gives links that also show that Maven, Eclipse, "Many Java applications" or "A lot of
well behaving [sic] Java applications" (per a few of the links), JBoss, Macintosh, NetBeans, IBM Java,
FreeBSD, Tomcat, the Android tools, shell scripts, and others use JAVA_HOME.

PEBKAC.
--
Lew
Knute Johnson
2013-02-22 23:34:54 UTC
Permalink
Post by Lew
Post by Knute Johnson
Post by Lew
Post by Knute Johnson
What program uses JAVA_HOME?
Seriously?
A zillion of them. It's the convention.
http://lmgtfy.com/?q=what+program+uses+JAVA_HOME
I do most of my development on Windows and it certainly isn't required
to make the compiler or runtime function there. I'm pretty sure I've
never set it on my Linux box either. From the link you posted I see
that ant uses it but I don't see anything else except Glassfish.
That search gives links that also show that Maven, Eclipse, "Many Java applications" or "A lot of
well behaving [sic] Java applications" (per a few of the links), JBoss, Macintosh, NetBeans, IBM Java,
FreeBSD, Tomcat, the Android tools, shell scripts, and others use JAVA_HOME.
PEBKAC.
What does PEBKAC mean? Have I been insulted?

k...
Lew
2013-02-23 02:55:56 UTC
Permalink
Post by Knute Johnson
Post by Lew
Post by Knute Johnson
Post by Lew
Post by Knute Johnson
What program uses JAVA_HOME?
Seriously?
A zillion of them. It's the convention.
http://lmgtfy.com/?q=what+program+uses+JAVA_HOME
I do most of my development on Windows and it certainly isn't required
to make the compiler or runtime function there. I'm pretty sure I've
never set it on my Linux box either. From the link you posted I see
that ant uses it but I don't see anything else except Glassfish.
That search gives links that also show that Maven, Eclipse, "Many Java applications" or "A lot of
well behaving [sic] Java applications" (per a few of the links), JBoss, Macintosh, NetBeans, IBM Java,
FreeBSD, Tomcat, the Android tools, shell scripts, and others use JAVA_HOME.
PEBKAC.
What does PEBKAC mean?
http://lmgtfy.com/?q=PEBKAC
Post by Knute Johnson
Have I been insulted?
I do not know.

Have you?
--
Lew
Lew
2013-02-21 06:53:21 UTC
Permalink
Isn't jdkhome ultimately set by the $JDK_HOME environment variable
if it's defined?

Or maybe it's just set by the netbeans.conf file. Here's mine, FWIW:

$ cat ${NETBEANS_HOME}/etc/netbeans.conf
#
netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/7.3beta2"
netbeans_default_cachedir="${DEFAULT_CACHEDIR_ROOT}/7.3beta2"

netbeans_jdkhome=/opt/java/java
netbeans_default_options="-J-Xms80m -J-Xmx640m -J-Xss2m -J-XX:PermSize=60m -J-XX:MaxPermSize=240m -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-ea -J-XX:+UseFastAccessorMethods -J-XX:+UseStringCache -J-XX:+OptimizeStringConcat -J-XX:+UseCompressedOops"

On my system "/opt/java/java" is a symlink to my default JDK_HOME.
--
Lew
Knute Johnson
2013-02-21 15:50:09 UTC
Permalink
Post by Lew
Isn't jdkhome ultimately set by the $JDK_HOME environment variable
if it's defined?
$ cat ${NETBEANS_HOME}/etc/netbeans.conf
#
netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/7.3beta2"
netbeans_default_cachedir="${DEFAULT_CACHEDIR_ROOT}/7.3beta2"
netbeans_jdkhome=/opt/java/java
netbeans_default_options="-J-Xms80m -J-Xmx640m -J-Xss2m -J-XX:PermSize=60m -J-XX:MaxPermSize=240m -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-ea -J-XX:+UseFastAccessorMethods -J-XX:+UseStringCache -J-XX:+OptimizeStringConcat -J-XX:+UseCompressedOops"
On my system "/opt/java/java" is a symlink to my default JDK_HOME.
I don't know. Apparently I was using _10 when I installed NetBeans and
it isn't smart enough to figure out the change.

So I changed the netbeans.conf file and I don't get the dialog any more.

knute...
Loading...