I'm trying to write a Java program in Intellij on Ubuntu 18.04. There is nothing wrong with the code, I can run it on my Windows machine at home.
When I'm trying to build the program i get the following error message:
Error:Cannot run program "/usr/bin/jdk1.8.0_202/bin/java" (in
directory "/home/oskar/.IdeaIC2019.1/system/compile-server"): error=2,
No such file or directory
First of check that /usr/bin/jdk1.8.0_202/bin/java is present - as in check that you have the Java SDK.
If you have it, Then you need to specify the SDK for your projectin iteliJ. To do this goto Project setting and select your SDK with the drop down, as shown below
Goto File -> Settings -> Project and you will see the bellow menu.
If you don't have the Java SDK there, go ahead and install the Java JDK download from https://www.oracle.com/technetwork/java/javase/downloads/index.html After installing the SDK, navigated to the Project Settings again and select the new JDK configuration from the installation location.
Then you can build the project and it should work all fine!
Related
I get the same issue as in this question when I do react-native run-android. I think it wants java 11 but I want to continue with 1.8. How can I do it?
Android Studio - 'com.android.internal.application' Java 11 - fix gradle projects not visibile in Android studio
what you need to do;
log into my computer
right click and select properties
enter advanced system settings
add new path name: JAVA_HOME
select the java 11 jdk location and save it
or
open cmd for adminstator
setx JAVA_HOME -m "path"
After doing all of them, delete your old React Native project and install a new one.
or
open project with android stiduo
find node_moduls -> react-native-gradle-plugin -> build.gradle -> change java 1.8 to java 11.0
Try following commands:
nano ./zshrc
Find JAVA_HOME and replace with your v11 java path.
You can find the path here:
/usr/libexec/java_home -V
Save the file, re-launch the terminal and try again.
I installed the default java extensions, downloaded jdk-13.0.2 windows installer, updated the path and JAVA_HOME in the environment variables. After searching for answers, I added the settings in VSCode for java.configuration.runtimes and java.home. After all that, when I try to run my java file in VSCode, it gives me the message "Java 11 or more recent is required to run the Java extension. Please download and install a recent JDK... Source: Debugger for Java (Extension)". I'm not sure what I'm missing or what I did wrong. I attached a screenshot of the VSCode settings.
Screenshot of VSCode settings
If you didn't add java to Environment Path, java.exe couldn't be recognized and used except under the java installation directory, and that's why the java extension think you didn't install the required JDK.
Add JAVA to PATH. You can refer to PATH IN The Java™ Tutorials
Press Ctrl+Shift+` in VS Code to open the integrated Terminal,
then run java --version to check if it's the right one;
Install Java Extension Pack in VS Code Extension Marketplace, which includes necessary extensions you need during development.
It seems restarting my computer took care of it. I verified that java was working outside of VS Code but VS Code wasn't wanting to work with java. No changes were made but when I reopened the project it works.
I am using windows and configured environment variables for Java 11.
On the terminal, java version is 11 as expected and I am to compile and run Java class files via the terminal.
On Intellij (Community Version 2018.3.5), used to have version 8 which worked fine. I am not able to get it to work since changing to version 11 (tested with brand new projects too).
Under project Structure, file path is set to C:\Program Files\Java\jdk-11 as expected.
Under Project settings/ module, version set to 1.11 JDK. Unable to change language level to 11. Max level possible is 9.
For Default Project settings, unable to select any options for target bytecode version.
When I try to run the main method, which has nothing but a print statement, I get following error message:
Error:Cannot run program "D:\Program Files\JetBrains\IntelliJ IDEA
Community Edition 2017.3.3\jre64\bin\java" (in directory
"C:\Users\username.IdeaIC2017.3\system\compile-server"):
CreateProcess error=2, The system cannot find the file specified
Why is it looking at some weird space when my jdk path has been specified at C:\Program Files\Java\jdk-11 already?
Please advice what I am missing. Added some screen shots for reference.
UPDATE: My version is Community Version 2017.3.5. Refer to my comment below.
2018.3.4 works fine for jdk > 1.8
The problem you are having is because of the settings that are being used
Error:Cannot run program "D:\Program Files\JetBrains\IntelliJ IDEA
Community Edition 2017.3.3\jre64\bin\java" (in directory
"C:\Users\username.IdeaIC2017.3\system\compile-server"): CreateProcess
error=2, The system cannot find the file specified
Reinstalling and not reusing the same settings from 2017 should work fine.
I have a mac running os x 10.9.4 and I downloaded the newest version of eclipse. It downloaded fine and installed but whenever I try to open it, I get an error that says, "Version 1.6.0_65 of the JVM is not suitable for this product." I downloaded and installed Java 7 and tried opening eclipse again only to get the same error. Anybody know how to fix this? Thanks
Make sure you have the JDK installed. Google will point you to the runtime engine (JRE) if you search for a Java download (probably called jre-7u67-macosx-x64). Click on "show all Java downloads" in the download page and look for a link "looking for the JDK?" on the left . As of today, the JDK can be found here and should have a name like jdk-7u67-macosx-x64 or jdk-8u20-macosx-x64. Both should be fine for a recent Eclipse Luna install.
If you want to run Eclipse Luna with Java 1.6, you can change the entry in the .ini file. Open the Eclipse application bundle by control-clicking and select "show contents". You will open a new finder window with a single folder "Contents". Open it, then open the folder "MacOS" and edit the file eclipse.ini which you will find inside. Change the line -Dosgi.requiredJavaVersion=1.7 to -Dosgi.requiredJavaVersion=1.6. Close and save, and now Eclipse will run in a minimum configuration. But you really want to install the 1.7 JDK.
For those using Mac OS X Mountain Lion (10.8)+. When you launch Eclipse for the first time, you may see the message "Eclipse can't be opened because it is from an unidentified developer."
To launch Eclipse for the first time, press the control key, click on the Eclipse icon, and select Open.
This one has me pretty frustrated...
I've installed the Java JDK and got the command line successfully pointed at it. When I open jar files through the terminal it uses the correct JDK to run the jar.
However, when I attempt to open the same jar via double-clicking it in Finder, it uses a different Java executable! In this case, the one that's located at /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java.
How can I change what Java executable Finder is using?
System Preferences > Java Control Panel > Java > View... :