NetBeans Forums

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

NetBeans 8.2: Can't find Java JDK and always loads main.cpp on debug run.

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
GameCodingNinja



Joined: 30 Jan 2016
Posts: 10

PostPosted: Sat Feb 11, 2017 11:59 pm    Post subject: NetBeans 8.2: Can't find Java JDK and always loads main.cpp on debug run. Reply with quote

I know what you're thinking but hold that thought, I do have Java JDK (8u121) installed.

I'm one of those crazy people who builds their own Linux via "Linux From Scratch". I recently rebuilt my Linux with the newest source code. This is where I'm seeing the problem. My previous build (which wasn't that old), NetBeans 8.2 found the JDK without any problems. What's also interesting, NetBeans 8.0.1 finds the JDK on my most current build. Odd.

I add the Java home and bin to the path like I always do.
Code:
export JAVA_HOME=/opt/jdk
export JAVA_BIN=/opt/jdk/bin
export PATH=$PATH:$JAVA_HOME:$JAVA_BIN


It's not a big deal. Once I get past the error message about not finding the JDK, Netbeans appears to work as it always does.

On a separate note. Every time I run my project via the debugger, it loads the main.cpp into the editor. Not sure why it does this. Noticed this when I started using NetBeans 8.2.
Back to top
paolosca



Joined: 09 Sep 2010
Posts: 513

PostPosted: Mon Feb 13, 2017 4:08 am    Post subject: NetBeans 8.2: Can't find Java JDK and always loads main.cpp on debug run. Reply with quote

Hi, I'm not sure it's related, but NetBeans now comes with it's own JRE, if you want to use the default system JDK you need to edit netbeans.conf (in my system it's in /usr/local/netbeans-dev/etc/) and comment the netbeans_jdkhome line.

To be clear, change the following line:
 
netbeans_jdkhome="/usr/local/netbeans-dev/bin/jre"



in:


#netbeans_jdkhome="/usr/local/netbeans-dev/bin/jre"




Then restart NetBeans.




Have a nice day,




Paolo


On Sun, Feb 12, 2017 at 7:59 AM, GameCodingNinja <address-removed ([email]address-removed[/email])> wrote:
Quote:
I know what you're thinking but hold that thought, I do have Java JDK (8u121) installed.

I'm one of those crazy people who builds their own Linux via "Linux From Scratch". I recently rebuilt my Linux with the newest source code. This is where I'm seeing the problem. My previous build (which wasn't that old), NetBeans 8.2 found the JDK without any problems. What's also interesting, NetBeans 8.0.1 finds the JDK on my most current build. Odd.

I add the Java home and bin to the path like I always do.

Code:
export JAVA_HOME=/opt/jdk
export JAVA_BIN=/opt/jdk/bin
export PATH=$PATH:$JAVA_HOME:$JAVA_BIN




It's not a big deal. Once I get past the error message about not finding the JDK, Netbeans appears to work as it always does.

On a separate note. Every time I run my project via the debugger, it loads the main.cpp into the editor. Not sure why it does this. Noticed this when I started using NetBeans 8.2.




Back to top
GameCodingNinja



Joined: 30 Jan 2016
Posts: 10

PostPosted: Sat Feb 18, 2017 3:47 pm    Post subject: Reply with quote

Editing the netbeans.conf to having it point to where the JDK is installed solved the problem. Thanks!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ 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 cannot 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