I am trying to run Oracle SQL Developer 22.2.1 under Manjaro 22.0.1 using openjdk version "17.0.6" 2023-01-17. For debugging purposes, I have experimented with and yielded the same results using openjdk version "11.0.18" 2023-01-17. Both have been installed using pacmanfrom the official arch repositories (jre17-openjdk and jre11-openjdk respectively).
This resulted in the following error:
> oracle-sqldeveloper
Error occurred during initialization of boot layer
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-17-openjdk/lib/libnio.so: /usr/lib/jvm/java-17-openjdk/lib/libnio.so: undefined symbol: reuseport_available
Inspecting libnio.so more closely, the culprit seems to actually be libjvm.so:
> ldd /usr/lib/jvm/java-17-openjdk/lib/libnio.so
linux-vdso.so.1 (0x00007ffe0f1d7000)
libjava.so => /usr/lib/jvm/java-17-openjdk/lib/libjava.so (0x00007f7354ce7000)
libnet.so => /usr/lib/jvm/java-17-openjdk/lib/libnet.so (0x00007f7354ccf000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f7354abb000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f7354d23000)
libjvm.so => not found
libjvm.so => not found
This is in turn located under /usr/lib/jvm/java-17-openjdk/lib/server/libjvm.so. A bit of research here and there yields setting the LD_LIBRARY_PATH as a potential solution. And indeed, by doing so, the application starts just fine!
Now finally on to my actual questions:
Is this some problem with my JDK installation and those links are supposed to work out-of-the-box?
I am regularly working with 2-3 different JDK installations (openjdk and GraalVM 8, 11 and 17). How would I best set the LD_LIBRARY_PATH for those different versions that each have their own lib directories?
Currently, I am only facing the problems with SQL Developer. I have already explicitly set the Java version to use in ~/.sqldeveloper/22.2.1/product.conf. Maybe there would also be a possibility to supply the library path in there? Using -Djava.library.path did not work so far.
As #thatjeffsmith has commented I would not expect SQLDeveloper to work 100% with OpenJDK (even if Oracle says so).
About your specific scenario the only answer I can think of is having scripts (think of catalina.sh or catalina.bat) to specify diferent locations for that specific environment variable (LD_LIBRARY_PATH). This is not a Java problem, but more a specific JNI problem, which needs to be solved under the JVM (as opposed to IN the JVM).
On my Manjaro installation, i've set the environment variables:
export JAVA_HOME=/usr/lib/jvm/default
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/default/lib/server
I set the variables appointing to the default symlink, to appoint to default JVM set from the archlinux-java program. Before set this variables, the Oracle SQL Developer has opened normally.
From the .desktop file, other change is necessary. To do this, you can use the menulibre to edit the Oracle SQL Developer SQL Entry. In the command field (equivalent to the line which starts from Exec= text), change to the below line:
env LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/default/lib/server /usr/bin/oracle-sqldeveloper
My solution is derived from the 'drslmr' solution to fix the Eclipse installation: https://aur.archlinux.org/packages/eclipse-java#news
Related
I have downloaded a fresh copy of sqldeveloper (sqldeveloper-4.1.3.20.78-no-jre) from the Oracle website. When I unzip it and lauch the GUI, I keep getting the following error message:
Warning - could not install some modules: Dynamic Module Config - No
module providing the capability org.netbeans.Netbinox could be found.
My system:
Windows 7 32 bit Hp Probook.
Jdk 1.6 , 1.7, 1.8 available in java/jdk
subdirectory.
Netbeans 8.0.2 installed
Finally got the way out after some dirty hours. Initially I extracted the sqldeveloper zip in a nested directory.
i.e: E://A/B/C/sqldeveloper.
starting sqldeveloper gui from the above directory threw erros.
Solution:
Go in C:\users**UserName**\AppData\Roaming : delete SQL Developer and sqldeveloper folders
Extract the Sql Developer zip in a new non nested directory. i.e: E://
Start it and should work now
Reference: https://community.oracle.com/thread/3870680?start=0&tstart=0
This is a very old post but I have had the same issue recently on version 22.2, and this might help.
WARNING: You may lose important settings with this solution.
Try deleting the system cache under C:\Users<your_user_name>\AppData\Roaming\SQL Developer\{whatever}
(or simply everything in that folder). This solved the problem for me, but obviously you do lose configuration settings, connections, and so on, ie, everything you've ever done in SQL Developer - so be careful.
In my case it was enough to change JDK pass to Java 8 in the
C:\Users\YourName\AppData\Roaming\sqldeveloper\19.2.1\product.conf file:
SetJavaHome C:\Program Files\Java\jdk1.8.0_202
I have Java 13 as default and although SQL developer complained at startup it worked OK with it until I started it and went away from the computer, so I missed the warning screen. After that it started to show the "could not install the modules" error.
For those that are working on a linux machine, for me worked just changing the jdk version that I'm currently using. I change went to the path usr/lib/jvm/ and look for the versions that my pc have. Then in ~/.sqldeveloper/"yourversion"/product.conf I changed the Java home to java-8-openjdk (It was using the 11 version)
In my case renaming/deleting only this folder was good enough:
C:\Users*username*\AppData\Roaming\SQL Developer\system22.2.0.173.2018
This way I could still import old connections after starting sqldeveloper again
Based on This I just deleted mypath\sqldeveloper\netbeans\platform\modules\org-netbeans-core-windows.jar and it works fine for me.
I found that I was getting this error after I reinstalled java while keeping an instance of sqldeveloper running.
After I ended the running instance, then I could start a new instance.
This is tricky, so when the could not install some modules board shows up, click the disable modules and continue, then immediately open the app again it should work :)))
The solution in my case was to unzip the SQL developer in a directory without special characters.
At first, I had exported it in a directory that included the hash (#) symbol.
I now have it in a nested directory again, without any special characters, and it works as expected.
I just updated to IntelliJ IDEA 16 which comes with Java JDK 1.8. Fyi, I had downloaded Java JDK 1.8 a long time ago.
I tried to run my plugin that I am developing, and I cannot even do that, I get the following error message (slightly condensed)
"C:\Program Files\Java\jdk1.7.0_45\bin\java" -Xmx512m -Xms256m -XX:MaxPermSize=250m -ea "-Xbootclasspath/a:C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 144.3143.6\lib\boot.jar" -Didea.config.path=C:\Users\Christopher.IdeaIC14\system\plugins-sandbox\config - ... -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.7.0_45\lib\tools.jar; ... ;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 144.3143.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.intellij.idea.Main
Unsupported Java Version: Cannot start under Java 1.7.0_45-b18: Java 1.8 or later is required.
So, I clearly know what the problem is; however, I cannot seem to figure out where the location to fix this is.
I have tried a lot of things so far; most involve using the search box in Settings and switching whatever I could to version 1.8. Also, I had updated my Environment Variable for Java from 1.6 to 1.8
With all of these changes, nothing is working! So how do I go about fixing this seemingly simple issue?
Set IDEA_JDK (or IDEA_JDK_64) environment variable.
Check Selecting the JDK version the IDE will run under
TL;DR --> Set JAVA_HOME to C:\Program Files\Java\jdk1.8.0_51
Java 8 is required to run IntelliJ IDEA starting from version 16 on all the supported platforms.
The actual JDK version used by the IDE can be verified in Help | About dialog (open any project to access the menu).
idea64.exe uses this JDK search in the following sequence:
IDEA_JDK_64 environment variable
..\jre64 directory
system Registry
JDK_HOME environment variable
JAVA_HOME environment variable
Under Arch Linux you can simply set java 8 as default (you must have it installed):
$ sudo archlinux-java set java-8-openjdk
In case anyone arrives here and hasn't had any luck with the other solutions, try this. I'm using PhpStorm under OSX, but the steps are probably applicable to JetBrains' other IDEs too:
Navigate to your IDE's config folder (see this article to learn how to find this folder's location).
Open the idea.propeties file.
If a JVMVersion attribute exists, delete that entire entry. If it doesn't exist, then this probably won't be of much help!
Save the file.
Launch your IDE.
Just set JAVA_HOME system variable to your JDK 8:
Run in cmd
setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_111"
don't foget to change to your java path
In my case, Ubuntu 14 (32-bit), I opened the file:
/home/<user>/Programs/PhpStorm/bin/phpstorm.sh
and after
if [ "$JDK" = "" ] && [ "$OS_TYPE" = "Linux" ] && ........... fi
I added:
if [ "$JDK" = "" ]; then
JDK="/usr/lib/jvm/java-8-oracle"
fi
And then it works!
Double check that your JAVA_HOME points to the correct 1.8 Installation and make sure that in the PATH env there is no reference to "C:\Program Files\Java\jdk1.7.0_45\bin".
Try to print your JAVA_HOME/PATH from the Console and see what the output is. If your changes are not reflected logout and then login again.
IntelliJ 16 REQUIRES Java 8 to run, it won't run under Java 7. It's compiled to Java 8 classes so it can't ever be run on an older JVM.
This is well and clearly mentioned in the documentation.
So if you have your system JVM be an older one, it will fail to start unless you coerce it into using a non-default JVM.
Possibly you have some java related executables left over in your Windows/System32 directory, where some older Java installers would drop them. Delete these by hand from the file system and see what happens.
Just in case this page needs one more recommendation, I fixed the problem in my case by going to the IDE's config folder (as #Nate puts it, see here for how to locate it), and deleting the idea.jdk file (which held a reference to a 1.6 VM).
Apart from setting the correct Java version for the global, per project and per module SDK, for the Java Compiler, and for the language level, you also must set the Target bytecode version both for the project and (if you use maven) for each maven module.
Often the project bytecode version is correct but the module bytecode version is lower, i.e. 1.5.
The per-module bytecode version is not displayed when opening the default preferences via File > Other Settings > Default Settings. You must edit the current preferences either via a shortcut (i.e. ⌘+,) or from the main menu as shown below (for mac):
I had the same problem. All paths pointing to java jdk 8, but still throwing the error. I was able to run Android Studio by running the "studio64.exe" instead "studio.exe" in the bin folder
This is a followup to this question.
MacOS X has the java command under /usr/bin. If one installs the JRE from Oracle, it doesn't work - claims there's no Java runtime, and offers to download and install Apple's runtime. But if you first run
export JAVA_HOME=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
then java works as expected. That's where Oracle JRE installs itself.
Now I'd like to use the Oracle Java VM in-process, and I can't - the "You need Java runtime" error message keeps popping up, even with JAVA_HOME being set.
Linking against the JavaVM framework causes the message on app startup, even before main().
Trying to dynamically load /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/server/libjvm.dylib and invoke JNI_CreateJavaVM causes the same message during the method call.
EDIT: the java command does it somehow, after all. I've poked around with a debugger, it does invoke JNI_CreateJavaVM at some point. I've even mimicked the arguments (there's one extra one, -Dsun.java.launcher=SUN_STANDARD), it didn't make any difference.
Found the answer here.
Instead of loading libjvm.dylib, one needs to load /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib. It exports JNI_CreateJavaVM, too. Call that one, and it'll work as expected.
Works even with JAVA_HOME not being set.
Future warning: Oracle says that since Java 1.9, the browser plugin technology will no longer be supported. With that in mind, Oracle JRE's home in version 1.9 might not be under Internet Plug-Ins anymore.
I just installed Android Studio on Elementary OS 0.3 Freya and run it using the terminal. On my first start-up, however, there's an error message shown:
Gradle 'Test' project refresh failed
Unable to start the daemon process. This problem might be caused by
incorrect configuration of the daemon. For example, an unrecognized
jvm option is used. Please refer to the user guide chapter on the
daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
Unrecognized VM option 'MaxPermSize=256m' Error: Could not create the
Java Virtual Machine. Error: A fatal exception has occurred. Program
will exit.
I read this and tried all the ways to solve it but to no avail. I did notice that his error was somewhat different from mine and thought that might be why I couldn't solve my problem using the ways suggested.
As I executed the .sh file on my terminal, it printed:
Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=250m;
support was removed in 8.0
(java:5094): Gtk-WARNING **: Unable to locate theme engine in
module_path: "pixmap"
Gtk-Message: Failed to load module "canberra-gtk-module"
I'm not sure whether it's related to the error or not. Please help.
In my case I had a line
org.gradle.jvmargs=-Xmx6408m -XX:MaxPermSize=6408m -XX:+HeapDumpOnOutOfMemoryError
in my gradle.properties file in the project structure.
removing -XX:MaxPermSize=6408m from that file fixed an issue
As it was already said in this thread, Permanent Generation was removed in Java 8, which is used in your case. I think, the easiest solution is to remove parameters associated with Permanent Generation during program execution.
Go to the directory where you have Android Studio. Then go to the bin/ subdirectory. Locate the following files, which contains Java Virtual Machine options:
studio.vmoptions
studio64.vmoptions
Open these files and locate line with MaxPerSize parameter. It should look as follows:
XX:MaxPermSize=256m
Remove this line in both files. I don't know if you are using 32-bit or 64-bit operating system, so you can update both files just in case.
I'm not sure if it will solve your problem, but I would try it in such situation. In my case, with this option and Java 8, I just get the warning, but Android Studio starts anyway. After removing this parameter, Android Studio still starts, but without warning. I'm using Ubuntu 14.04 LTS.
EDIT:
There is another solution for this problem described here: https://stackoverflow.com/a/27913562/1150795.
Go to File > Other Settings > Default Project Structure > JDK location and check the path.
In case of Ubuntu Linux, we can set /usr/lib/jvm/java-7-oracle as default JDK if we are using Oracle JVM. JDK 7 is the safest option for Android.
-XX:MaxPermSize was deprecated in JDK 8, marked as obsolete in JDK 16, and removed in JDK 17. It was superseded by the -XX:MaxMetaspaceSize option.
Change -XX:MaxPermSize to -XX:MaxMetaspaceSize solve my problem.
ref:
https://github.com/expo/expo-cli/issues/4196#issuecomment-1035850918
https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#removed-java-options
In my case opening $ANDROID_HOME/tools/lib/monitor-x86_64/monitor.ini and removing
XX:MaxPermSize=256m
from it did the job.
Oh I've solved this problem, I install Oracle JDK 9 when android studio runs on JDK 6 or JDK 7 (if I'm not mistaken).
so I uninstalled Oracle JDK 9, then download and install the JDK 7.
On MacOS the following clause in ./gradlew injects this option:
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\" \"-Xmx1024m\" \"-Xms256m\" \"-XX:MaxPermSize=1024m\""
fi
This file can be edited by hand after the project has been generated.
i had the same issue and i was able to solve it by adding this directly in the terminal
export JAVA_VERSION=1.8
and then try the
I'm trying to open Oracle SQL Developer on my Windows7 64-bit.
When I tried to open SQL Developer it asked for java.exe path and I gave C:\Java\jdk1.6.0_34\jre\bin\java.exe
I got an error from Oracle SQL Developer saying: Unable to find a Java Virtual Machine. To point to a location of a JVM. Please refer to oracle9i jdeveloper install guide (jdev install.html)
Any clue on how to fix this?
Another Solution:
This worked for me several times. Install JDK7 and point to location of jdk7\jre\bin\java.exe
Probably this is you are looking for (from this post):
Oracle SQL developer is NOT support on 64 bits JDK. To solve it,
install a 32 bits / x86 JDK and update your SQL developer config file,
so that it points to the 32 bits JDK.
Fix it! Edit the “sqldeveloper.conf“, which can be found under
“{ORACLE_HOME}\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf“, make
sure “SetJavaHome” is point to your 32 bits JDK.
Update:
Based on #FGreg answer below, in the Sql Developer version 4.XXX you can do it in user-specific config file:
Go to Properties -> Help -> About
Add / Change SetJavaHome to your path (for example - C:\Program Files (x86)\Java\jdk1.7.0_03) - this will override the setting in sqldeveloper.conf
Update 2: Based on #krm answer below, if your SQL Developer and JDK "bits" versions are not same, you can try to set the value of SetJavaHome property in product.conf
SetJavaHome C:\Program Files\Java\jdk1.7.0_80
The product.conf file is in my case located in the following directory:
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0
I just installed SQL Developer 4.0.0.13 and the SetJavaHome can now be overridden by a user-specific configuration file (not sure if this is new to 4.0.0.13 or not).
The location of this user-specific configuration file can be seen in the user.conf property under 'Help -> About' on the 'Properties' tab. For example, mine was set to:
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf
On Windows 7.
The first section of this file is used to set the JDK that SQLDeveloper should use:
#
# By default, the product launcher will search for a JDK to use, and if none
# can be found, it will ask for the location of a JDK and store its location
# in this file. If a particular JDK should be used instead, uncomment the
# line below and set the path to your preferred JDK.
#
SetJavaHome C:\Program Files (x86)\Java\jdk1.7.0_03
This setting overrides the setting in sqldeveloper.conf
The solution that worked for me:
If you have Sqldeveloper with java incorporated, you can use the \sqldeveloper\bin\sqldeveloper.bat to launch sqldeveloper as told here.
Version 1.5 is very, very old.
In the latest builds, we support 32 and 64 bit JDKs. In version 4.0, we find the JDK for you on Windows. If the software can't find it, it prompts for that path.
That path would look something like this
C:\Java\jdk1.7.0_45
You can read more about this here.
“C:\Users\admin\Downloads\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf” is misleading, it’s not the file which sets the Java Home variable. The actually file used is”%AppData%\sqldeveloper{PRODUCT_VERSION}\product.conf” [in my case it is "%AppData%\sqldeveloper\1.0.0.0.0\product.conf"]
The secret is you need to copy msvcr100.dll to the path where the installation says msvcr100.dll is missing (dialog box) and then try to install the sql developer.
For me I had to create bin folder in
C:\sqldeveloper\jdk\bin
and Copy msvcr100.dll to it.
If still not working! Try this!
You might also need to change the config file settings found in
C:\sqldeveloper\sqldeveloper\bin
Download and install 32 bit JDK (Windows) and set the path in config file as
SetJavaHome C:/Program Files (x86)/Java/jdk1.7.0_01
There is another route of failure, besides the version of Java you are running: You could be running out of Heap/RAM
If you had a once working version of SQLDeveloper, and you are starting to see the screenshot referenced in the original post, then you can try to adjust the amount of space SQLDeveloper requests when starting up.
Edit the file:
/ide/bin/ide.conf
Edit the line that specifies the max ram to use: AddVMOption -Xmx, reducing the size. For example I changed my file to have the following lines, which solved the issue.
#AddVMOption -Xmx640M # Original Value
AddVMOption -Xmx256M # New Value
If you have a 64-bit version of SQL Developer, but for some reason your default JDK is a 32-bit JDK (e.g. if you develop an Eclipse RCP application which requires a 32-bit JDK), then you have to set the value of the SetJavaHome property in the product.conf file to a 64-bit version of JDK in order to run the SQL Developer.
For example:
SetJavaHome C:\Program Files\Java\jdk1.7.0_80
The product.conf file is in my case located in the following directory:
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0
The solution described above worked in my case. The solutions of #evgenyl and #FGreg did not work in my case.
The Oracle SQL developer is not supported by the 64bit JDK.
To resolve this issue:
Install a 32bit JDK (x86)
Update your SQL developer config file (It should now point to the new 32bit JDK).
Edit the sqldeveloper.conf, which can be found under {ORACLE_HOME}\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
Make sure SetJavaHome is pointing to your 32bit JDK.
For example:
SetJavaHome C:\Program Files (x86) \Java\jdk1.6.0_13
This is known to happen even if there are some syntactical errors in your heap space setting in the sqldeveloper.conf.
If you have defined the heap space in any of the wrong ways mentioned here,
it still will show the same error when you launch it.
EDIT :
The correct way to set your heap size parameters would be something like this:
AddVMOption -XX:MaxPermSize=256M
AddVMOption -Xms256M
AddVMOption -Xmx768M
I also had the same problem after installing 32 bit version of java it solved.