Building older NetBeans project in bash leads to error - java

I am opening an older NetBeans project and I want to build it using ant in bash with debian. However, when I try to run ant, I get this error
BUILD FAILED
/home/karelbilek/NetBeansProjects/oldProject/nbproject/build-impl.xml:528:
The following error occurred while executing this line:
/home/karelbilek/NetBeansProjects/oldProject/nbproject/build-impl.xml:261:
Unable to find a javac compiler; com.sun.tools.javac.Main is not on
the classpath. Perhaps JAVA_HOME does not point to the JDK. It is
currently set to "/usr/lib/jvm/java-7-openjdk-i386/jre"
What does that mean? What should I do? In "/usr/lib/jvm/java-7-openjdk-i386/jre" there seems to be an actual JRE when I look there, so what is the problem?

You're pointing to a JRE (Java runtime environment) but not a JDK (Java development kit).
Only the JDK contains the compiler (javac). The JRE is used for running Java programs but doesn't carry the extra components of the JDK (compiler etc.)

it happened for me and i got through it by installing the jdk
sudo apt-get install openjdk-7-jdk
After installing jdk, the classpath executed right

Related

Gradlew unable to find a javac compiler

So I am trying to create a Workspace for eclipse from gradlew. And I am getting the following error:
Execution failed for task ':makeStart'.
> Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre1.8.0_131"
But I`ve set JRE_HOME and JAVA_HOME correctly(JAVA_HOME points to jdk folder and JRE_HOME to jre folder). But gradlew sees wrong jdk path. What may caurse this problem?
It is currently set to "C:\Program Files\Java\jre1.8.0_131"
That means you do not have a JDK installed, but a JRE, meaning, you only have the runtime environment but not the development kit that contains the compiler.
Install a Java JDK and set the environment accordingly.

Netbeans - Use correct JRE for debugging on Kubuntu

I know this question has been asked before, but the solutions do not work.
I've installed a new jdk 1.8 and configured it as platform. In netbeans.conf I've configured netbeans_jdkhome="/home/niklas/Java/jdk1.8.0_65/".
using update-alternatives I've configured the new jre for java. java -version correctly returns "java version "1.8.0_65"
Nevertheless running my project from inside netbeans it does not load, instead the "javafx requires newer version" error appears.
When I run exactly the same project with java -jar it runs correctly.
What did I forget to configure?
After long try-and-error here my solution:
the standard ubuntu package seems not to contain javafx. Therefore netbeans has to be installed from netbeans downloadpage.
Step-by-step solution:
Uninstall netbeans (e.g. sudo apt-get remove netbeans)
Download netbeans-8.1-javase-linux.sh
Run sh netbeans-8.1-javase-linux.sh --javahome /[PATH_TO_JDK]/jdk1.8.0_[VERSION] (note that this installer fails without warning if you use [PATH_TO_JDK]/jre/)
Edit [INSTALLATION_DIR]/etc/netbeans.conf
Make sure netbeans_jdkhome="[PATH_TO_JDK]" points to the right path (it didn't in my case.) and has no # before
note that the "All"-linux installer from the downloadpage is broken today (11.11.2015). Maybe this will be fixed soon.

IntelliJ IDEA can't run application with JDK

When I run my web application with Tomcat, I get an error as follow:
Caused by: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "D:\jdk1.7.0_60\jre"
I set JAVA_HOME in Configuration, but unfortunately no effect.
SDKs setting in Project Structure:
========================================================
Problem has been solved!
Application get exception when doing Ant javac task, set the "fork" property true then it find extJavac.
Appreciate #Michael Hobbs and #Dimitri Hautot.
JRE means "Java Runtime Environment". There is no javac compiler in it.
The JRE is actually a subfolder of the JDK (Java Development Kit, where the compiler is).
Make sure your paths are correctly set in IntelliJ settings, and refer to the JDK, not the JRE.
EDIT: looking at the proposed path, all starting with "D:\jdk1.7.0_60\jre", maybe you installed a JRE on your computer, instead of a JDK. This might be the cause of the problem.
Project Structure -> SDK does not effect JAVA_HOME. This must be set in the OS. I'm surprised IntelliJ, ran with a JAVA_HOME issues. Should be something alone the lines of:
Linux shell export JAVA_HOME=/home/michael/jdk1.7.0_65
Windows How to set java_home on Windows 7?

"Unable to find a javac compiler" - while trying to generate an android app with RoboHelp 10

I am exploring a trial version of Adobe's Technical Communication Suite. Following this video, I am trying to generate an Android app using a sample document.
I've tried changing the file paths for the JDK and apache.ant files, but keep receiving the same error message (see below).
BUILD FAILED
C:\Program Files (x86)\Android\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:713: The following error occurred while executing this line:
C:\Program Files (x86)\Android\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:727: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jre7"
I got the same error but in a linux system and solved it by knowing that: JDK is a super command for JRE.
JRE: Java Runtime Environment only runs not compile or build (eg. using ant).
JDK: compiles and runs.
So try changing your java setting to JAVA_HOME= ..../java OR .../jdk not .../jre.
It seems that you didn't configure your JAVA variable environment.
BTW, I don't know what IDE you are using. As far as I know, if you have more than one java versions in your computer, in eclipse you should set variables.
(1) window->preference-> left column (Java)->Compiler, you could change different compiler version.
(2) And in left column (Java) -> Installed JRE, you should also modify the JRE version.

JAVA_HOME does not point to the JDK : Unable to start google app engine

I get the following errors when i try to run a sample project in netbeans on google app server. The server doesn't start up. How can i resolve these errors if they exist ? I am using netbeans 7.1
BUILD FAILED
W:\UnderTest\NetbeansCurrent\Guestbook\nbproject\build-impl.xml:550: The following error occurred while executing this line:
W:\UnderTest\NetbeansCurrent\Guestbook\nbproject\build-impl.xml:300: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre7"
Install jdk and set JAVA_HOME in environments variables to path that you jdk was installed. Currently it points to jre.
probable solution will be hear : setting jdk path in netbeans
or , if you setting JAVA_HOME in windows env then use %JAVA_HOME%

Categories