unable to run sqldeveloper on debian - java

I have installed jdk1.6.0_21 and sqldeveloper(using alien) on debian(lenny). Now when I run sqldeveloper it asks for J2SE installation path, after I type the jdk path it exits with the below error message.
Oracle SQL Developer
Copyright (c) 2008, Oracle. All rights reserved.
Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored in ~/.sqldeveloper/jdk
/usr/java/jdk1.6.0_21
/opt/sqldeveloper/sqldeveloper/bin/../../ide/bin/launcher.sh: line 430: /root/.sqldeveloper/jdk: No such file or directory
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Error: SQL Developer can't recognize the JDK version

You might want to issue the following command:
echo '/usr/lib/jvm/java-6-sun' > ~/.sqldeveloper/jdk

also it can be
/usr/lib/jvm/java-6-openjdk

on the sqldeveloper home there is a file named sqldeveloper.sh (or datamodeler.sh) add the folowin line:
unset GNOME_DESKTOP_SESSION_ID
should be look like this:
#!/bin/bash
unset GNOME_DESKTOP_SESSION_ID
cd "`dirname $0`"/sqldeveloper/bin && bash sqldeveloper $*
That's all.
Adios

There are several possible causes for this error message:
The VM can't find the rt.jar file
The VM and the rt.jar file don't match (e.g. VM is version 1.6.x, rt.jar is version 1.4)
The JDK wasn't installed properly
What's the output of the following commands?
which java
java -version
/usr/java/jdk1.6.0_21/bin/java -version

Finally I found the problem, JDK was not installed properly. I installed a fresh copy of OpenJDK after that it is working fine.

I've got the same when i will install my SQL Developer as root, but use it as other user.. In my case looks like the Sql developer was makes file ~/.sqldeveloper/.... as root:root privilegies, but in home dir with sudo user.. It's strange but easy to fix as
chown youruser:yourgroup -R ~/.sqldeveloper

When you get several error messages that don't seem to make any sense, start by looking at the first error. In this case, that would be:
/root/.sqldeveloper/jdk: No such file or directory
It looks like sqldeveloper is trying to write the file, and failing. Are you running this as root? If not, can you think of any reason why sqldeveloper would think that your home directory is /root/?

It looks as if the two java versions (OpenJDK accessible via /usr/bin/java and JDK 1.6.0_21 get mixed up). I can only guess how it can be solved:
run update-alternatives --set java /usr/java/jdk1.6.0_21/bin/java
try to uninstall OpenJDK
possibly, you need to do both

Only replace in /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf
from:
SetJavaHome ../../jdk
to:
SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64

Related

Problem starting OWASP ZAP with OpenJDK 11 installed

when I try to start OWASP ZAP, after installing, the following messages appears: "This application requires a Java Runtime Environment 1.8.0". I have installed OpenJDK 11 properly, updated the environment variables rightly. Could you help me, please?
Try starting zap.bat file, that worked for me!
Solution: Installing OpenJDK with the msi file. The installer has an option "JavaSoft (Oracle) registry keys". When this is activated, the 1.8.0 message disappears in my case. If it is not selected the error persists.
I encountered this error message recently on a Windows 10 machine when I wanted to run VOSViewer. I had installed Adopt OpenJDK by unzipping the files and updating the system variables (Path and JAVA_HOME). When checking java -version, it showed the correct one.
MSI Installer options
Try downloading and installing jdk 11 ,
Visit https://www.oracle.com/in/java/technologies/javase/jdk11-archive-downloads.html
In my case using ZAP 2.12.0, the only solution that worked was to edit the zap.bat file, I had to specify the full path to the Java executable, so the last line becomes:
C:\jdk-17.0.5+8-jre\bin\java.exe %jvmopts% -jar "C:\Program Files\OWASP\Zed Attack Proxy\zap-2.12.0.jar" %*
Adjust for your JDK/JRE install directory as appropriate

Unable to Start Talend Tool JAVA Version incompatibility

My Talend tool version is 5.6. As mentioned in Talend documentation it needs Java Runtime Environment 7 i.e jdk1.7, which is installed - along with set java_home in my environment variables. As per me it should work.
However I have jdk1.8 installed too, but I'm correctly pointing jdk1.7 path at environment variable.
Alternatively I have tried giving jdk1.7 path in Talend's Talend-Studio-win-x86_64.ini file. It's still giving me error.
Below is snapshot: in cmd the installed version shows jdk1.8 where in echo %JAVA_HOME% it shows path of jdk1.7
While starting tool this error comes:
Create a batch file with the following command:
Talend-Studio-win-x86_64.exe -vm "[jdk path]\bin"
Then start the studio by executing this batch.
Talend is based on eclipse, so you can set the java vm to use in the ini-file. (Sorry, I don't have an installation here right now, I think it is called talend.ini - nevertheless, it is located in talend's installation folder.)
Add the following to the top of the file:
-vm
[path to your java 7]/bin/javaw.exe
try to make changes in TOS_DI-win-x86_64.ini file
add line
-vm
C:\Program Files\Java\jdk-11.0.14\bin\javaw.exe
And update or confirm the version as below.
-Dosgi.requiredJavaVersion=11.0.14
Hope it'll help to fix the issue
Suppose you have talend in c:\talend and jdk1.7 is in C:\jdk1.7.
You can do like the following in windows environment.
Open command prompt.
Goto the bin folder location where jdk 1.7 is located. For example if you have jdk in C:\jdk1.7 then
cd\
cd C:\jdk1.7\bin
Then from bin folder of jdk type the full uri of the executable and hit enter.
In the above supposition c:\jdk1.7\bin>c:\talend\tos_di-xxxxx.exe
In the above statement tos_di-xxxxx.exe is the executable file depending on the os environment

Oracle SqlDeveloper can not find correct JDK

I'm trying to install Oracle SQLDeveloper4 on my windows7 machine.
I set JAVA_HOME to point my jdk 1.7,
I add to my PATH variable %JAVA_HOME%/bin. When I echo and java -version I can see it is Java 1.7 and when I echo I can see it is in the %PATH%
I even set it in its sqlDeveloper.conf file to point to my jdk1.7;
SetJavaHome C:\Java\jdk1.7
BUT STILL Whenever I run the sqldeveloper.exe I get warning saying it can not run on Java 1.6 and it needs Java1.7 !!
How can I get this stupid thing installed on my machine?? very frustrating..
Goto the file:
C:\Users\<USER>\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf
In this file
eg:
SetJavaHome <PATH>\jdk1.7.0_67
It turned out to be that there is an IBM JDK1.6 folder on some irrelevant directory for some other project..It was there even I uninstalled all other JDK's yesterday..Today I just deleted that JDK folder..than all of a sudden sqldeveloper found the java1.7 and started working..WTF=WTF

Eclipse fails to start via an application launcher

Hi everybody.
The problem: elcipse-3.5.0 (Galileo) spits with an error when I try to launch it by clicking its launcher. The curse sound like this:
A Java Runtime Environment (JRE) or
Java Development Kit (JDK) must be
available in order to run Eclipse. No
Java virtual machine was found after
searching the following locations:
/home/emanemos/bin/eclipses/eclipse-3.5.0/jre/bin/java
java in your current PATH
However, everything goes smoothly when eclipse is started from console.
Before installing eclipse I've installed jdk1.6.0_16. I also created the $JAVA_HOME variable and changed my $PATH:
$ echo $JAVA_HOME
/usr/lib/java/jdk1.6.0_16
$ echo $PATH
/home/emanemos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/java/jdk1.6.0_16/jre/bin
So that, my terminal got to know what java is:
$ java -version java version
"1.6.0_16" Java(TM) SE Runtime
Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build
14.2-b01, mixed mode, sharing)
Then a folder eclipse was extracted from .tar.gz package under the directory ~/bin/eclipses. I changed the folder's name eclipse to eclipse-3.5.0 and changed $PATH again:
$ echo $PATH
/home/emanemos/bin/eclipses/eclipse-3.5.0:/home/emanemos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/java/jdk1.6.0_16/jre/bin
From this moment I was blessed to launch eclipse from console by the command eclipse.
However, I feel desperate about using the eclipse's application launcher.
Thanks in advance. I would be grateful for any help.
The message says "No Java virtual machine was found after searching the following locations: /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin/"
I have solved it creating the folder /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin and linking to the command at /usr/bin/java:
ln -s /usr/bin/java /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin/java
Add this to eclipse.ini:-
-vm
$Java_home/jdk1.5.0_14/bin/javaw.exe
I could be off, but it looks to me that you don't have JAVA in your path. If you notice, you had to add it via the echo command. However, that only stays for that session of the terminal. You don't permanently affect the system. (I believe that's why you can launch from the terminal, but not via the launcher.)
Do you have the Java JRE actually installed on your system? If not, I would recommend doing that as that should do all the setup that you would need, then try running Eclipse again.
Edit: I noticed you said that you did install the 1.6 JDK. This should have fixed your problem. If Java is not in your path when you first open up your terminal, then that (I believe) is your real problem and you may need to do a reinstall or troubleshoot there.
(Making a big assumption that you're on Linux using X)
If you've installed the Java JRE without logging out and back in to the X session, the environment the session is in won't contain the $JAVA_HOME variable. It may just be a case of logging out and back in in order to get a new X session.
If you want to keep the same session running, you could try it out by pressing Ctrl+Alt+F9 to start another GUI session.
Fazil Baghirzade i solve the this problem
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations:
c:\Program Files\Eclipse\jre\bin\javaw.exe 'javaw.exe' in your current path
go to the "C:\Program Files\Java\jdk1.6.0_39" in this folder have "jre" folder copy it and paste the eclipse folder
thats all!!!

"Could not find the main class. Program will exit"

I'm trying to run SQuirreL SQL.
I've downloaded it and installed it, but when I try to run it I get this error message:
Java Virtual Machine Launcher.
Could not find the main class.
Program will exit.
I get the gist of this, but I have not idea how to fix it. Any help?
more info:
I'm on Windows XP pro.
I have java 1.6 installed, and other apps are running OK.
The install ran OK.
I believe I've followed the installation instructions correctly.
To run it, I'm invoking the squirrel-sql.bat file.
Update
This question: "Could not find the main class: XX. Program will exit." gives some background on this error from the point of view of a java developer.
Is Java installed on your computer? Is the path to its bin directory set properly (in other words if you type 'java' from the command line do you get back a list of instructions or do you get something like "java is not recognized as a .....")?
You could try try running squirrel-sql.jar from the command line (from the squirrel sql directory), using:
java -jar squirrel-sql.jar
The classpath is the path that the system will follow when trying to find the classes that you're trying to run. In the batch file you're trying to execute it probably has a variable like CLASSPATH=blah;blah;etc or a java command that looks similar to
java -classpath "c:\directory\lib\squirrel-sql.jar" com.some.squirrel.package.file
If you can find or add that classpath setting, make sure that it includes a path to the squirrel-sql.jar and any other jar files that it may depend on separated by semicolons (or the root /lib directory that may be included with the installation).
Basically you just need to tell java where to find the class files that you're trying to execute. Wikipedia has a more indepth discussion about classpath and can offer you more insight. http://en.wikipedia.org/wiki/Classpath_(Java)
JAVA_HOME variable must be set, to point to the prog files/java/version???/bin
open squirrel-sql.bat file with some text editor and see if the JAVA_HOME variable there is the same as the one in your enviroment variable
change it if it doesn't match....and than run bat file again
Have you followed these instructions:
http://www.squirrelsql.org/#installation
If so, are you running the batch file or the shell script to run it?
Tweaking MB's answer for windows, will get rid of the console window:
start javaw -jar squirrel-sql.jar
The .bat file does not seem to work.
Just double-click on:
squirrel-sql.jar
or type:
java -jar squirrel-sql.jar
in the command-line.
You can place .; in classpath in environmental variables to overcome this problem.
I tried to start SQUirrel 3.1 but I received a message stating "Could not find the main class Files\Rational\ClearQuest\cqjni.jar" I noticed that C:\Program Files\Rational\ClearQuest\cqjni.jar is in my existing classpath as defined by the Windows environment variable, CLASSPATH.
SQUirrel doesn't need my existing classpath, so I updated the SQUirrel bat file, squirrel-sql.bat.
REM SET SQUIRREL_CP=%TMP_CP%;%CLASSPATH%
SET SQUIRREL_CP=%TMP_CP%
It no longer appends my existing classpath to its classpath and runs fine.
I had this problem when I "upgraded" to Windows 7, which is 64-bit. My go to Java JRE is a 64-bit JVM. I had a 32-bit JRE on my machine for my browser, so I set up a system variable:
JRE32=C:\Program Files\Java\jre7
When I run:
"%JRE32\bin\java" -version
I get:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
Which is a 32-bit JVM. It would say "Java HotSpot(TM) 64-Bit" otherwise.
I edited the "squirrel-sql.bat" file, REMarking out line 4 and adding line 5 as follows:
(4) rem set "IZPACK_JAVA=%JAVA_HOME%"
(5) set IZPACK_JAVA=%JRE32%
And now everything works, fine and dandy.
I had the same issue with a different application (BI Publisher) because I installed a 32 bit version of this application on a 64 bit version of Windows.
Java Virtual Machine Launcher - could not find the main class
The solution for my case was to tell BI Publisher where to find the x86 version of JRE:

Categories