I installed Java, but for some reason NetBeans wont compile my code, I am getting error:
C:\Users\Jay\Desktop\Key Stroke Project\nbproject\build-impl.xml:609: The following error occurred while executing this line:
C:\Users\Jay\Desktop\Key Stroke Project\nbproject\build-impl.xml:250: Error running ${platform.javac} compiler
Any ideas?
The line is:
target="${javac.target}" tempdir="${java.io.tmpdir}">
Open a command shell and type javac -version. You should see the version of Java you installed echoed back.
If the operating system complains about not being able to find the javac.exe command, then you need to add JAVA_HOME/bin to your PATH.
If you don't have a JAVA_HOME/bin, then perhaps you installed the JRE instead of JDK by mistake.
You may need to tell NetBeans how to find Java as well. I'm an IntelliJ user, so I can't be of much help there.
Related
It's definitely installed, I can run Minecraft. But I'm trying to run a .jar file and Windows 11 is asking "How do you want to open the file?" And java compiler doesn't show up. btw I've treid where java, it said java didn't exist on the computer
UPDATE: I solved the problem but not the issue, there were some mods that were incompatible with eachother
You could try to find it out via printing your PATH.
On Windows: Open the command line via
Start -> CMD
Paste in
echo %PATH%
There you should be able to find the java path. Otherwise try to search for JRE.
By the way it is not always 100% sure that you have the java runtime and java compiler installed.
JRE = Java Runtime Environment for executing .jar
JDK = Java Development Kit for compiling java files and creating .jar files
Please help. I'm having issues syncing up my JDK and jpackage versions for creating standalone java programs. The JDK version and the runtime version being included with jpackage are mismatched (JDK16 programs being paired with JDK15 runtimes).
Typing java -version into the command line, it matches up with the current %JAVA_HOME% environment variable configuration, showing JDK16.0.2 (located at C:\Program Files\Java\jdk-16.0.2). This is working correctly.
However the problem becomes more apparent when I type jpackage --version, it reports that it's using JDK15.0.1 - which as far as I know, I've never installed and I'm unsure of where it's running from. This is a problem, since I need to be able to build Java16 programs with jpackage. As it is now, this results incompatible runtimes and JAR files.
I've been googling to no avail. I can't compile my JDK16 programs into installers because it keeps trying to use JDK15.0.1 for the runtime.
For now, I've managed to bypass this strange and seemingly locked configuration by accessing JDK16's jpackage exe manually this way and adding the commands after:
“C:\Program Files\Java\jdk-16.0.2\bin\jpackage.exe”
Any advice is helpful. Perhaps this temporary workaround will be helpful to anyone else with the same problem down the line.
Use the Windows where command to find out what the jpackage command is actually resolving to. It seems clear that jpackage without the full path name is resolving to jpackage in a different installation of Java.
Note that %JAVA_HOME% does not determine how the Windows cmd.exe resolves commands. Command resolution is done according to %PATH%.
The symptoms you describe:
jpackage says %JAVA_HOME% is incorrect but %JAVA_HOME% refers to Java 16
jpackage -version says Java 15 (not Java 16)
"C:\Program Files\Java\jdk-16.0.2\bin\jpackage.exe" works
are all consistent with your %PATH% being incorrect ... and that you do have a Java 15 installation on your machine, and it is on the %PATH% ahead of, or instead of the Java 16 installation you are trying to use.
Note jpackage is no longer an "incubator" tool in Java 16. It has been promoted to full support; see JEP 392: Packaging Tool. So the warnings about incubator mudules are also consistent with jpackage resolving to the wrong Java installation.
This really boils down to understanding what the Windows %PATH% variable is and how it effects the behavior of Windows command shells. (It is analogous to $PATH in Linux, UNIX and Mac OSX command shells.)
I'm installing GIT/SBT/ETC on a new Windows 10 computer. I have installed GIT and SBT and Java JDK13. I also added the appropriate JAVA_HOME and PATH variables for java.
Now when I go to do "sbt -version" I get the following output. The first time I ran it after setting the path variables correctly it did a bunch of stuff but ended with this error. Now I only get the error when I run the version command.
$ sbt -version
error: error while loading package, Missing dependency 'object java.lang.Object in compiler mirror', required by C:\Users\WilliamWelch\.sbt\boot\scala-2.10.6\lib\scala-library.jar(scala/package.class)
error: error while loading package, Missing dependency 'object java.lang.Object in compiler mirror', required by C:\Users\WilliamWelch\.sbt\boot\scala-2.10.6\lib\scala-library.jar(scala/runtime/package.class)
sbt script version: 1.3.4
All my googling turns up using some portions of these errors is that I should use JDK 8 but that isn't even supported anymore (as evidenced by needing an account to download it) so I can't imagine whatever bug that was hasn't been fixed in SBT by now.
Any ideas?
I am running on a Windows 7 machine.
I installed Java jdk 1.7.
I have set the Path and PATH environment variable to point to the Java jdk 1.7/bin directory.
Executing java -version in the command prompt yields Java version 1.7.0_45.
However when I execute javac it says that:
javac is not recognized as an internal or external command
I am really stumped on this problem. All other threads seem to get similar issues resolved via changing the environment variable but this is not solving my problem in this situation.
Edit
When I run java -version in Console2 it says that the currently used version of Java is 1.6 and I am not sure why this is the case.
Not sure if this is the cause, but in the path you posted
C:\Program Files\Java\jdk1.7.0_45 \bin
Looks like an extra space in between of "jdk1.7.0_45" and "\bin"
Also it's always good to append ";" at the end.
PATH = C:\Program Files\Java\jdk1.7.0_45\bin;
Chnage it to C:\Progra~1\Java\jdk1.7.0_45\bin and it shall work like magic :)
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.