I get the following error in Netbeans:
Platform home (platform.home property) is not set. Value of this property should be Sun Java(TM) Wireless Toolkit 2.5.2_01 for CLDC emulator home directory location.
BUILD FAILED (total time: 0 seconds)
if I delete 57. row in build .xml
<fail unless="platform.home">Platform home (platform.home property) is not set. Value of this property should be ${platform.active.description} emulator home directory location.</fail>
I got the following is missing
package javax.microedition.io does not exist
import javax.microedition.io.Connector;
I use Netbeans 6.9.1, java JDK 1.6 update 24 is installed, and Java ME SDK 3.0 is also installed
What I should to do?
This is usually due to not having any emulator chosen.
Related
HISTORY
Android Studio was installed successfully the first time during a walk through as part of a Flutter tutorial (including installing Git and Flutter)
Trying to launch Android Studio the second time produced the following error:
[Error launching Studio
If you already have a 64-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.
Failed to create JVM. JVM Path: C:\Users\Anthony.AndroidStudio4.0\jre\jre]1
RESEARCH
I've seen several YouTube videos addressing this that appear to be successful, but just don't work for me.
Video showing how to delete VMoptions file and check JAVA_HOME:
(my folders seem to be configured differently, but I have two VMoptions files in the bin and one in the AppData\Roaming\Google\AndroidStudio4.1 The one in AppData just contained a link to an Android support page, but the one in bin had a lot of data. It was deleted (first just the contained data within and later the file was deleted entirely)
Key points:
It seems that the issue is either with Android Studio or the Java JDK
JAVA
I've downloaded and installed Java JDK 13, and set the bin folder as the environment variable (both system variable and path) as shown in https://www.youtube.com/watch?v=IJ-PJbvJBGs
I've also tried with JDK 8 (legacy version) with the same results
ANDROID STUDIO
I've uninstalled and reinstalled Studio 4.1 and the same thing happens. I can't locate prior versions on their site.
COMPUTER Windows 10, i7, 32gb ram
value = "C:\Program Files\Android\Android Studio\jre"
Android studio 4.1, Flutter
I installed Netbeans 11.3 under Ubuntu 18.04 and created in the following a new Groovy project.
Choose File > New Project (Ctrl-Shift-N;\u2318-Shift-N on Mac) from the main menu to open the New Project wizard.
Select Java Application in the Java category. Click Next.
Type GroovyJavaDemo as the Project Name and specify the folder where you want to create the application in the Project Location field.
Deselect the Create Main Class checkbox. Click Finish.
Next, I created a Groovy Script file with only this content println "Hello" and it caused the following problems:
ant -f /home/ubuntu/NetBeansProjects/GroovyJavaDemo -Djavac.includes=Hello.groovy -Drun.class=Hello run-single
init:
deps-jar:
Created dir: /home/ubuntu/NetBeansProjects/GroovyJavaDemo/build
Updating property file: /home/ubuntu/NetBeansProjects/GroovyJavaDemo/build/built-jar.properties
Created dir: /home/ubuntu/NetBeansProjects/GroovyJavaDemo/build/classes
Created dir: /home/ubuntu/NetBeansProjects/GroovyJavaDemo/build/empty
Compiling 1 source file to /home/ubuntu/NetBeansProjects/GroovyJavaDemo/build/classes
/home/ubuntu/NetBeansProjects/GroovyJavaDemo/nbproject/build-impl.xml:1120: The following error occurred while executing this line:
/home/ubuntu/NetBeansProjects/GroovyJavaDemo/nbproject/groovy-build.xml:26: Error running forked groovyc.
BUILD FAILED (total time: 1 second)
What did I miss?
Thank you in advance,
I don't think you missed anything, since I can reproduce your problem with JDK 11 on NetBeans 11.3.
However, there is a (somewhat unsatisfactory) workaround that worked for me:
Install JDK 8 (if necessary).
Edit the NetBeans file etc/netbeans.conf and set the JDK that NetBeans uses to JDK 8. In my case I added the line netbeans_jdkhome="C:\Java\jdk1.8.0_221" to netbeans.conf.
Restart NetBeans then rebuild your project. It should compile now:
Notes:
You could bug report this issue to the NetBeans team if you wish.
I also tried using JDK 14 as the default Java platform for NetBeans and got a different error: NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7. See the Gradle bug JDK 14 support #10248 for more information on that.
Setting JDK 8 as the default platform for NetBeans doesn't prevent you from adding other Java platforms (Tools > Java Platforms > Add Platform...) such as JDK 11 and JDK 14 for your individual projects.
Edit the groovy-build.xml and replace <groovyc javahome="${platform.home}" with <groovyc javahome="${jdk.home}" it works for me on JDK 1.8
Please find here the solution for Open-JDK-13
This question already has answers here:
Android N requires the IDE to be running with Java 1.8 or later?
(17 answers)
Closed 6 years ago.
Inspite of having JDK 8 installed, I'm getting this error. What can the issue be?
Check installed java version, it should be 1.8 or later.
MBP-Vitaliy:~$ java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
Check java version in Android Studio.
In Mac OS X: Android Studio -> About Android Studio.
Where JRE should be 1.8 or later.
If you have another, In Mac OS X go to Applications folder find AndroidStudio.app and click Show content, then find in Content folder Info.plist file and change JVM VERSION to 1.8 manually.
<key>JVMVersion</key>
<string>1.8</string>
Restart Android Studio.
for mac users #Vitaliy Movchan answer works.
for windows users (who has to set JAVA_HOME in their operative system):
Install the JDK 1.8 and note the destination path, usually C:\Program Files\Java\jdk1.8.0_xx
Right-click My Computer and select Properties.
Click the Advanced System Settings link in the left column.
In the tab Advanced click Environment Variables
Create or modify the variable JAVA_HOME.
Enter the variable value as the installation path for the Java Development Kit.
You can still get the layout rendered during design time in the IDE if you choose Android version 23 (Marshmallow) rather than version 24 (Nougat).
This isn't a long-term solution, but for most purposes it should be good enough. You can always see the actual Nougat layout by running your app in the Android emulator.
Add JVMVersion 1.8*, 1.8+ to info.plist of android studio app and also check for default java version
I had the same problem, in my system i have installed 3 jdks.
jdk1.6, jkd1.7, and jdk1.8.
I am working on some projects which requires jdk 1.7 so i can't change JAVA_HOME.
So i have found another solution by tell android studio which JAVA_HOME needs to be used.
So i just edit studio.sh file and added JAVA_HOME variable.
JAVA_HOME = /usr/lib/jvm/java-8-oracle/
studio.sh file
After Restart android-studio started pointing to jdk 1.8.
Hope this will help.
I installed jdk 1.8 and set the JAVA_HOME variable in my ubunut 16.04 LTS machine.
After that I downloaded Anypoint studio and extracted the files in it. Then when I run the studio it is getting opened properly. But remaining controls seems not working properly.
For example, When I click on windows->preferences and searching for 'JRE', it is not searching at all. Did anyone has same/similar issues?
You should check and see if Anypoint Studio supports Java 8 currently. I just switched to version 3.8 and my Studio seems to "want" Java 1.7. I have version 8 Java on my machine but I noticed that the latest version of Anypoint Studio (using 3.8 Mule EE) wants to use 1.7. I tried to select my 1.8 Java and it said that Anypoint Studio would still be using a compiler compliance level of 1.7.
Go read the documentation on the Mule site.
HTH
I had Java 1.7.0_21 installed and I installed 1.7.0_45 today after uninstalling the previous version. Now Android Studio has stopped compiling projects and says that it cant locate the 1.7.0_21 folder. How can I set the new path for Java SDK? I have changed the environment variables also but didn't work.
Up to Android Studio 4.2
Go to File > Project Structure > SDK Location. The third field is "JDK Location" where you can set it. This will set it for the current project.
To set the default for new projects, go to File > Other Settings > Default Project Structure > SDK Location and set the "JDK Location".
Android Studio Arctic Fox (2020.3.1)
In the Canary 14 of Android Studio Arctic Fox (2020.3.1), the JDK Location setting is moved to:
Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK
Older Versions
Go to File > Project Structure > [Platform Settings] > SDKs. You'll need to either update you current SDK configuration to use the new directory, or define a new one and then change your project's settings to use the new one. This will set it for the current project.
To set the default for new projects, go to File > Other Settings > Structure for New Projects > [Platform Settings] > SDKs and set the SDK to use when creating a new project.
Go to File> Project Structure (or press Ctrl+Alt+Shift+S),
A popup will open now go to SDK Location Tab you will find JDK Location there refer this image to be more clear.
I tried updating all of my SDKs by just going into the Project Structure > Platform Settings > SDKs and changing the Java SDK, but that didn't work, so I had to recreate the configurations from scratch.
Here's how to create your SDKs with the latest Java:
In Project Structure > Platform Settings > SDKs, click the "+" button to add a new SDK.
In the pop-up, go into your Android SDK folder and click "Choose"
Another pop-up will appear asking for which SDK and JDK you want to use. Choose any Android SDK and the 1.7 JDK.
Go to Project Structure > Project Settings > Project and change your Project SDK to the one you just created. You should see the name of the SDK contain the new Java version that you installed.
C:\Program Files\Android\Android Studio\jre\bin>java -version
openjdk version "1.8.0_76-release"
OpenJDK Runtime Environment (build 1.8.0_76-release-b03)
OpenJDK 64-Bit Server VM (build 25.76-b03, mixed mode)
Somehow the Studio installer would install another version under:
C:\Program Files\Android\Android Studio\jre\jre\bin>java -version
openjdk version "1.8.0_76-release"
OpenJDK Runtime Environment (build 1.8.0_76-release-b03)
OpenJDK 64-Bit Server VM (build 25.76-b03, mixed mode)
where the latest version was installed the Java DevKit installer in:
C:\Program Files\Java\jre1.8.0_121\bin>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Need to clean up the Android Studio so it would use the proper latest 1.8.0 versions.
According to How to set Java SDK path in AndroidStudio?
one could override with a specific JDK but when I renamed
C:\Program Files\Android\Android Studio\jre\jre\
to:
C:\Program Files\Android\Android Studio\jre\oldjre\
And restarted Android Studio, it would complain that the jre was invalid.
When I tried to aecify an JDK to pick the one in C:\Program Files\Java\jre1.8.0_121\bin
or:
C:\Program Files\Java\jre1.8.0_121\
It said that these folders are invalid. So I guess that the embedded version must have some special purpose.
This problem arises due to incompatible JDK version.
Download and install latest JDK(currently its 8) from java official site in case you are using previous versions. Then in Android Studio go to File->Project Structure->SDK location -> JDK location and set it to 'C:\Program Files\Java\jdk1.8.0_121' (Default location of JDK). Gradle sync your project and you are all set...
And now this is located in Gradle settings:
1) File >>> Project Structure OR press Ctrl+Alt+Shift+S
2) In SDK Location Tab you will find SDK Location:
3) Change your Project SDK location to the one you have installed
4) Sync your project
If you are using new android studio 2021+ then you can find or update JDK settings by navigating to
File > Settings... > Build, Execution, Deployment > Build Tools >
Gradle
on windows
Android Studio > Preferences... > Build, Execution, Deployment > Build
Tools > Gradle
on Mac
Go to File>Project Structure>JDK location:
Here, you have to set the directory path exactly same, in which you have installed the java version.
Also, you have to mention the paths of SDK for project run on emulator successfully.
Why This Problem Occurs: It is due to the unsynchronized java version directory that should be available to Android Studio for java code compilance.
Click "use embedded JDK" on version Android Studio 3.2.1