testmycode / tmc-intellij

*BETA* TestMyCode plugin for IntelliJ IDEA
MIT License
24 stars 13 forks source link

Unable to test code - "BUILD FAILED" "Error running javac.exe compiler" #132

Open NoobGains opened 6 years ago

NoobGains commented 6 years ago

I get the following error when trying to test my code using the TMC plugin for IntelliJ. Note that I am able to run (using both the TMC plugin arrow and the regular IntelliJ arrow). I was also able to submit my code to the server and it came back successfully. I tried to build the code manually by going to Build -> Build Project but that did not resolve the error.

BUILD FAILED C:\Users\Cody\Documents\IdeaProjects\TMCProjects\2013-OOProgrammingWithJava-PART1\week1-001.Name\nbproject\build-impl.xml:603: The following error occurred while executing this line: C:\Users\Cody\Documents\IdeaProjects\TMCProjects\2013-OOProgrammingWithJava-PART1\week1-001.Name\nbproject\build-impl.xml:245: Error running javac.exe compiler

Total time: 0 seconds

-pre-init:

-init-private:

-init-user:

-init-project:

-init-macrodef-property:

-do-init:

-post-init:

-init-check:

-init-ap-cmdline-properties:

-init-macrodef-javac-with-processors:

-init-macrodef-javac-without-processors:

-init-macrodef-javac:

-init-macrodef-junit:

-init-debug-args:

-init-macrodef-nbjpda:

-init-macrodef-debug:

-init-macrodef-java:

-init-presetdef-jar:

-init-ap-cmdline-supported:

-init-ap-cmdline:

init:

-deps-jar-init: [delete] Deleting: C:\Users\Cody\Documents\IdeaProjects\TMCProjects\2013-OOProgrammingWithJava-PART1\week1-001.Name\build\built-jar.properties

deps-jar:

-warn-already-built-jar: [propertyfile] Updating property file: C:\Users\Cody\Documents\IdeaProjects\TMCProjects\2013-OOProgrammingWithJava-PART1\week1-001.Name\build\built-jar.properties

-check-automatic-build:

-clean-after-automatic-build:

-verify-automatic-build:

-pre-pre-compile:

-pre-compile:

-copy-persistence-xml:

-compile-depend:

-do-compile: [javac] Compiling 1 source file to C:\Users\Cody\Documents\IdeaProjects\TMCProjects\2013-OOProgrammingWithJava-PART1\week1-001.Name\build\classes

nygrenh commented 6 years ago

It sounds like your computer is using the Java Runtime Environment (JRE) instead of the Java Development KIT (JDK). Have you installed the JDK?(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

NoobGains commented 6 years ago

The Java file I downloaded/installed is jdk-8u152-windows-x64.exe and the specific version is 8.0.1520.16. And I have never downloaded JRE.

matjojo commented 6 years ago

Same problem here, using File -> Project structure -> Project ->Project SDK I've confirmed my JDK version is 1.8._162, this version works for Minecraft mod development, so there shouldn't be anything wrong with my files.

BUILD FAILED
C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-002.HelloWorld\nbproject\build-impl.xml:603: The following error occurred while executing this line:
C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-002.HelloWorld\nbproject\build-impl.xml:245: Error running javac.exe compiler

Total time: 0 seconds

-pre-init:

-init-private:

-init-user:

-init-project:

-init-macrodef-property:

-do-init:

-post-init:

-init-check:

-init-ap-cmdline-properties:

-init-macrodef-javac-with-processors:

-init-macrodef-javac-without-processors:

-init-macrodef-javac:

-init-macrodef-junit:

-init-debug-args:

-init-macrodef-nbjpda:

-init-macrodef-debug:

-init-macrodef-java:

-init-presetdef-jar:

-init-ap-cmdline-supported:

-init-ap-cmdline:

init:

-deps-jar-init:
   [delete] Deleting: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-002.HelloWorld\build\built-jar.properties

deps-jar:

-warn-already-built-jar:
[propertyfile] Updating property file: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-002.HelloWorld\build\built-jar.properties

-check-automatic-build:

-clean-after-automatic-build:

-verify-automatic-build:

-pre-pre-compile:

-pre-compile:

-copy-persistence-xml:

-compile-depend:

-do-compile:
    [javac] Compiling 1 source file to C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-002.HelloWorld\build\classes

When trying to run the tests without compiling first the same problems happens. Sending to server works correctly for both instances.

BUILD FAILED
C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\nbproject\build-impl.xml:603: The following error occurred while executing this line:
C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\nbproject\build-impl.xml:245: Error running javac.exe compiler

Total time: 0 seconds

-pre-init:

-init-private:

-init-user:

-init-project:

-init-macrodef-property:

-do-init:

-post-init:

-init-check:

-init-ap-cmdline-properties:

-init-macrodef-javac-with-processors:

-init-macrodef-javac-without-processors:

-init-macrodef-javac:

-init-macrodef-junit:

-init-debug-args:

-init-macrodef-nbjpda:

-init-macrodef-debug:

-init-macrodef-java:

-init-presetdef-jar:

-init-ap-cmdline-supported:

-init-ap-cmdline:

init:

-deps-jar-init:

deps-jar:
    [mkdir] Created dir: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\build

-warn-already-built-jar:
[propertyfile] Updating property file: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\build\built-jar.properties

-check-automatic-build:

-clean-after-automatic-build:

-verify-automatic-build:

-pre-pre-compile:
    [mkdir] Created dir: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\build\classes

-pre-compile:

-copy-persistence-xml:

-compile-depend:

-do-compile:
    [mkdir] Created dir: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\build\empty
    [mkdir] Created dir: C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\build\generated-sources\ap-source-output
    [javac] Compiling 1 source file to C:\Users\matth\Documents\IdeaProjects\TMCProjects\mooc-2013-OOProgrammingWithJava-PART1\week1-003.Spruce\build\classes
amakhnev commented 6 years ago

I am running plugin with Idea 2018.1.2 on Windows 10 and had the same problem. I solved this by adding JDK bin folder to the windows PATH variable.

StephanieCzetli commented 6 years ago

I am also using IntelliJ IDEA (2018.2.3 x64) with the Helsinki MOOC for Java & Test My Code (TMC) and experienced the same problem and error messages as above.

Here is a link to Oracle I used that solved the problem. I can now run & test my code!!

https://www.java.com/en/download/help/path.xml