Netbeans - Automatic Java ME SDK platform addition failing - netbeans

I am trying to setup Java ME SDK 8.3 with Netbeans 8.2. I followed the following install order:
Java SE Development Kit 8u152
Java ME SDK 8.3
Netbeans 8.2
Then I try to add Java ME SDK 8.3 to Java Platforms
Tools --> Java Platforms --> Java ME CLDC Platform Emulator --> Choose Java ME SDK Directory, then automatic detection fails.
I have tried re-installing Java ME SDK and Netbeans. But it didn't help. How to solve this?

The problem is that SDK 8.3 isn't CLDC but rather CDC.
A lot of people are confused by this, which is understandable. I have no clue why Oracle thought it was a good idea to keep the name "JavaME SDK" but leave out MIDP and CLDC starting from version 8.
What you need to download is Java ME SDK 3.4 (or the latest v3.x). This is the last Java ME SDK that contains CLDC API's.

You can manually add the path for your Java SDK in the netbeans.conf file.
Right-click on your desktop and click properties and open location:
Open Dir C:\Program Files\NetBeans-15\netbeans\etc
Open File netbeans.conf
goto
# Default location of JDK:
# (set by installer or commented out if launcher should decide)
#
# It can be overridden on command line by using --jdkhome <dir>
# Be careful when changing jdkhome.
# There are two NetBeans launchers for Windows (32-bit and 64-bit) and
# installer points to one of those in the NetBeans application shortcut
# based on the Java version selected at installation time.
netbeans_jdkhome="PATH TO YOUR SDK"

I was facing the same error. Installing Sun Java Wireless Toolkit worked for me.
Link: http://www.oracle.com/technetwork/java/index-jsp-137162.html

Related

Flutter: Cannot determine path to 'tools.jar' library for Android API 30 Platform (C:/Users/Sam/AppData/Local/Android/Sdk)

I'm having difficulty uploading my upgraded project to Google Play.
I need to produce a signed version of the app, but if I try App bundle it complains I have an obsolete Gradle plugin, that I can't upgrade. I have a bleeding edge gradle version in my gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
So I try to create a signed apk and give it a keystore, but when it tries to output the app it throws this complaint:
Cannot determine path to 'tools.jar' library for Android API 30
Platform (C:/Users/Sam/AppData/Local/Android/Sdk)
I've tried the existing answers, setting a JAVA_HOME under advanced system variables, that didn't work.
I copied tools.jar from my java directory to C:/Users/Sam/AppData/Local/Android/Sdk, that didn't work.
I'm knashing my teeth.
After mucking around I think I have found the solution. I did not have JDK 1.8 on my machine but jdk 1.16. But that is no good because we need JDK1.16 does not include tools.jar. So:
Install Oracle's JDK 1.8 on your machine if you don't have it.
Go to your Android Studio and do this:
Select the root node of your project and then use File->Project Structure
Under Platform Settings / SDKs, use the + Icon to "Add JDK" and add the newly installed JDK 1.8 here. C:\Program Files\Java\jdk1.8.0_311
Crucial Step : After adding this JDK, in the same screen i.e. Platform Settings/SDKs, click on Android API 31 Platform. Here, in the JAVA SDK field, drop down the options and select 1.8. If you don't see 1.8 here, restart Android Studio and/or add C:\Program Files\Java\jdk1.8.0_311 to JAVA_HOME
That's is what fixed it for me.

NetBeans 8.2 does not open on Mac OS

I am trying to start NetBeans 8.2 on a Macbook Pro and it's not working.
It shows the splash screen, then after a while it shuts down without starting anything.
Running from the command-line I can see this error:
Oct 02, 2017 7:40:28 PM org.netbeans.ProxyURLStreamHandlerFactory register
SEVERE: No way to find original stream handler for jar protocol
java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.net.URLStreamHandler java.net.URL.handler accessible: module java.base does not "opens java.net" to unnamed module #7823a2f9
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:175)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:169)
at org.netbeans.ProxyURLStreamHandlerFactory.register(ProxyURLStreamHandlerFactory.java:82)
at org.netbeans.JarClassLoader.<clinit>(JarClassLoader.java:141)
at org.netbeans.MainImpl.execute(MainImpl.java:178)
at org.netbeans.MainImpl.main(MainImpl.java:85)
at org.netbeans.Main.main(Main.java:83)
Looks like Java 9 got bundled with it and it's causing an error. The documentation implies that NetBeans 8.2 uses JDK 8!?
How to use my own java to run NetBeans, or how to get NetBeans to start without this error?
Yes, NetBeans 8.2 does use JDK 1.8, and specifically does not support JDK 1.9.
It's unclear from the OP which version of Java is desired to run with NetBeans, but the version of NetBeans to use is governed by the version of Java to be used:
[1] For Java 8, use Netbeans 8.2. Note that Java 9 is not supported. You can download NetBeans 8.2 bundled with JDK 8u141 for Mac OS here:
http://www.oracle.com/technetwork/articles/javase/jdk-netbeans-jsp-142931.html
Once it has been installed it no specific configuration for Java should be necessary.
[2] For Java 9 you must use a Development Build of NetBeans. That can be downloaded from http://bits.netbeans.org/download/trunk/nightly/latest/ but be sure that Mac OS X is selected from the Platform drop list before clicking Download.
For any version of NetBeans you can specify your own version of Java as follows:
Start NetBeans and select Java Platforms from the Tools menu.
Click the Add Platform... button.
Complete the wizard to locate the version of Java you want to use.
One final point: there is no problem having multiple versions of NetBeans installed and running concurrently using different JDKs, typically NetBeans 8.2 with JDK 1.8 and NetBeans Dev Build with JDK 1.9.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update:
If NetBeans closes itself down on startup it may have an invalid JDK path. To change the JDK that NetBeans uses:
Locate the file netbeans.conf. It should be in the etc directory under the NetBeans installation directory.
Edit that file in a text editor. Locate the line containing the property netbeans_jdkhome. On my Windows 10 installation it looks like this:
netbeans_jdkhome="C:\Java\jdk1.8.0_121"
Change the value for that property to specify the path to the desired JDK, save the file and restart NetBeans.
As pointed in the comments:
I had tried to set netbeans_jdkhome in /Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf to point to JDK 10, but still it did not work.
I had to install JDK 8, and set netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home"
Uninstalling JDK 10 and using JDK 8 worked for me and setting netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home" worked quite well.
macOS 10.13.5
JavaJDK 10 installed as "System" JVM
I was able to install NetBeans, but unable to get it to function. Window would open, clicking on "New Project" or "New File" did absolutely nothing.
Was able to get it working (all modules and servers) by going into the configuration file at
/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
and editing the commented out path to JDK at the bottom of the file!
Cheers!
Check Java JDK is installed on Mac, NetBeans 8.2 does use JDK 1.8(Java SE 8)
/usr/libexec/java_home -V
Matching Java Virtual Machines (2):
12.0.1, x86_64: "Java SE 12.0.1" /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
1.8.0_211, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
if not , just install (no need remove exist JDK)
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
modify /Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home"
For NetBeans 8.2 JDK 1.8 should be used. If you installed JDK 1.9 or JDK 10.0 to your MacBook, you must uninstall that from your computer.
I had the same issue. I'm using Apache Netbeans 12.0 so I had to change my OpenJDK version from 19.0 to 14.0 and update the path in order to finally work.
No need to uninstall the 19.0, just install the version that works with the Apache that you have and update the path:
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk14.0.jdk/Contents/Home"

Checkstyle-Idea plugin with Android Studio

With the latest version of the plugin, I have found that it is incompatible with Android Studio since it requires Java 8. It recommends the JetBrains IDE with pre bundled Java 8 for Mac users.
Has anyone found a way to get this plugin working with Android Studio? Thanks in advance!
Add a new enviroment variable for your current User named JAVA_HOME pointing to your Java 8 installation.

How Do I make the Install4j IDE to upgrade to Java7 instead of Java6

I have upgraded to Java7 recently.
I had my install4j Project file in Java6.
Now in the Install4j IDE, I go to Media wizard and download 1.7 JRE's and select them for Windows. (I have window 7 64 bit.)
But When I go the Installer tab in IDE , where for some of the screens I have my custom code which is compiled in Java7.
It gives an error for the IDE java version lower than the compiled version(for those class files).
The Common Location where is the JRE for 1.6 was downloaded C:\Program Files\Common Files\i4j_jres
But the JREs for 1.7 somehow are never downloaded in the common location.
How Do I make the Install4j IDE to upgrade to Java7 instead of Java6.
Thanks
Sony
We had the same problem as you, so we just swapped out install4j's built-in JRE with the one we used to compile our custom code.
i.e. - replace "C:\Program Files\install4j5\jre" with the jre you use to build your custom actions.
Under General Settings->Java version, change the minimum version to 1.7

QML Preview compatibility check failed. QML preview is disabled

I am on Mac 10.8.2, i have both java 1.6 (32/64bit enabled) and java 1.7 on my machine and the JAVA_HOME is pointed to java 1.6, but whenever I try to enable QML previewing in my momentics ide (QNX® Momentics® IDE for BlackBerry® 10 Native SDK, Version: 10.0.9), I get the error in the Title. looked a bit into the log under workspace/.metadata/.log, and it logged the following:
!MESSAGE QML Preview compatibility check log.
Error: This Java instance does not support a 32-bit JVM.
How can I get the ide to point to java 1.6? Is it somewhere in the startup script of the application that I can change?
Thanks
QNX Momentics is based on Eclipse, so you should be able to change the JVM used by editing the .ini file for the IDE. If your Momentics is installed in the default location, in Finder navigate to:
/Applications/bbndk/ide/macosx/x86/eclipse/
Right click on qde.app (if you have extension hidden it might just be qde with the momentics icon) and choose Show Package Contents.
Under /Contents/MacOS/ edit the qde.ini file in TextEdit.
At the top of the file, before -vmargs add the following:
-vm
/path/to/your/java/jvm/here
ie.
-vm
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
Save the file and launch Momentics, and it should now be using the JVM you specified. Check your workspace/.metadata/.log after the startup to confirm this.
I've met the same problem with you, I've tried #nonesuchnick 's answer but unfortunately that did not work for me.
And I've similar environment with you: I've got Java 1.7 (the Oracle one) and 1.6 (the Apple one) installed on my Mac (10.8.2).
I resolved my problem via this way:
Delete Java 1.7 completely
Check your NDK installer's md5 to ensure you've got the correct one.
To delete Java 1.7 completely, you'll need to delete the jdk1.7 folder under
/Library/Java/JavaVirtualMachines/
and delete the internet plugin JavaAppletPlugin.plugin under
/Library/Internet Plug-Ins
Then open terminal and type java -version to make sure that your PATH variables is correctly set to your java 1.6 path (I mean the Apple one).
Upon finish this, you can try to uninstall the BB10 NDK and reinstall it, then try to enable the QML Preview, this time it should work.
Reference:
How do I uninstall Java 7 for my Mac?