How can I set the jdk in an eclipse portable version? - java

I installed Eclipse portable and installed it on a drive. Everything worked fine. On the same disk is a Java Version.
If I start Eclipse and want to create a Java Project how I did it in the past, it will not work. There is no jdk set. I looked up the problem on the internet and just found a fix where you have to set the jdk file in the setings under the bulletpoint Java but it's not there.
Does anybody know a fix? Any suggestions? - Thanks!

In the portable version of Eclipse, inside eclipse folder open the file eclipse.ini in notepad or notepad++ and add the following in the last. Before this, you have to close the eclipse.
-vm C:\Java\JDK\1.8.0\bin\javaw.exe
After making changes, you can start eclipse. For more details, refer this link.
https://wiki.eclipse.org/Eclipse.ini

Related

Intellij IDEA is not able to detect jdk what to do?

I have recently moved from windows to ubuntu-22.04 and it is a bit confusing.
I have installed intellij IDEA, after installing java and jdk, but still intellij is not able to detect the jdk version installed in my pc.intellij not detecting jdk
The path of installed java is also set but still it is not working in intellij.Path of installed java. what should I do, I am not able to use intellij IDEA for java programming.
I have tried setting up the path in .bashrc file but still there is no change in intellij IDEA.
.bashrc file.
From the screen of your first screenshot, Click "Download JDK", then select the version you need.
What you might already have installed is the Java Runtime

one program(eclipse Mars) need java 8 and one program(console app) need java 7 what to do?

when I open eclipse Mars it ask for java 8(for JavaFX), and then When I did install java 8u74 now some of my older java app showing that it need java 7(my older installed version). And when I tried to keep both I found some of faculty said to not keeping both. I don't know what to do? Please Kindly help me?
When I open eclipse Now It is showing:
"You are not running your eclipse instance with Java7 or Java8. The JavaFX tooling is disabled because of this.Make Java7/8 the default system java or adjust your eclipse.ini to pass -vm pointing to your Java7/8 install."
You can try to manually change the Java library for a specific project.
Right click on the project folder, then go to:
properties->Java Build Path->Libraries->Add Library
and there add the Java 7 library.
If this doesn't work or you don't see the Java 7 library you might need to add some environment variables (e.g. JAVA_HOME)
Go to the eclipse installation folder and modify the below property in eclipse.ini file:
-Dosgi.requiredJavaVersion=1.7
Hope this helps!

Google App Engine JSP can't deploy: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

this is hopefully something simple but... Eclipse has been working relatively fine for everything except deploying to GAE.
I can run my GAE app locally, but when I try to deploy to google, I get this message:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
I have set the build path to JDK.
It also happens when trying to deploy the same project from more than one system (win7 and win8) so I suspect the problem is to do with the project itself. This particular project is existing and already running on google for years.
Interesting that this error only shows up when I have .jsp files in my app to deploy. If I remove the jsp files, it deploys without error. (kinda need the jsp files tho)
thanks
link to image of my build path
I had the same problem and was able to deploy successfully after forcing Eclipse to use
the JRE within my SDK directory (Win 7 64bit). To force Eclipse to use a particular JRE see this. It seems that the JVM that Eclipse uses, the JVM that app engine spawns, & the JVM that appconfig uses should all be the same. Hope this helps w/ your situation as well.
I tried setting my project jre to be the same as my eclipse jre according to AlohaCode's answer. This was insufficient for me. The answer was in my classpath, there is java.exe in C:\windows\system32 which was BEFORE my java home variable.
The solution is to put the java home path before the C:\windows\system32 entry.
I found the answer here: 2FL5sJ">https://groups.google.com/forum/?fromgroups=#!msg/google-appengine-java/RyFybJWUhU4/78UE_2FL5sJ
In Eclipse, go to: Window->Preferences->Java->Installed JREs , add->Standard VM TO JDK PATH\JRE. and If you had a JRE checked previously uncheck it and check this jre
The given advice solved my problem. The -vm argument cannot be the first line.
-vm
C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javaw.exe
Setting -vm in eclipse.ini did not help. All other settings were seemingly pointing to the JDK. Out of desperation, I uninstalled all JREs from my system, leaving only the JDK. The consequence was that Eclipse would not start as the JDK bin directory was not on my PATH (Windows 8 here). Adding this in environment system variables got Eclipse to start. Thereafter I could deploy to app engine.
Removing the JRE file located in my C:/Program Files(*86)/Java folder , reopening the eclipse IDE resolved the issue.
I had Java JDK installed in my C:/Program Files/Java folder which was not detected earlier.

Missing libraries with oracle-java7-jdk in eclipse on ubuntu 12.04

I recently installed the ubuntu 12.04 final beta
After installing the oracle jdk from the webupd8 ppa, launching eclipse failed complaining about a missing shared library.
Can't load library: /home/bob/.swt/lib/linux/x86_64/libswt-gtk-3740.so
I searched around, and found this quesion: Eclipse cannot load SWT libraries
As the OP recommended, I tried switching to open-jdk, and that worked wonderfully. The problem, however, is that I am working on a project that doesn't support openjdk.
I tried the second solution as well (the one by scott, which was just creating symbolic links to /usr/lib/jni/... in ~/.swt/lib/linux/x86_64/). Eclipse launches and everything is fine, but it still misses some libraries; this is what I get when i try to run my project:
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libgdx/1352105074/libjogl_awt-linux64.so: libjawt.so: cannot open shared object file: No such file or directory
I know libjawt.so is somewhere on my computer:
$ locate libjawt.so
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/libjawt.so
/usr/lib/jvm/java-7-oracle/jre/lib/amd64/libjawt.so
But eclipse or java seems to think that libraries should be placed in ~/.swt/lib/linux/x86_64, isn't that weird?
Eclipse when launched defaults to its own internal JRE, as I understand. I recommend the following:
Modify your CLASSPATH variable to include the path to the desired libraries;
Set your JAVA_HOME to match the actual JAVA_HOME;
Setup Eclipse to launch from the desired JVM by customizing the eclipse.ini using this information: http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#eclipse.ini
Also, can you specify the -classpath option when Eclipse is launched?
Try downloading the latest version of Eclipse and running it. For some reason it works fine. I just ditched my older version of Eclipse. I hope this works for others!
Please note that there are two Java runtimes in play here. The one used to run Eclipse itself, and the one you want to run your code. They do not have to be the same!
I would suggest
Run Eclipse with a JDK that works
Download Oracle JDK manually and unzip it to a folder in your home directory
Tell Eclipse about this additional runtime (http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm)
Configure your project to use that JVM instead. (http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-assign_default_jre.htm)
Now your own code is compiled against, and runs with Oracle Java.

Android SDK Zip - Windows 64bit Home Variable

I'm using the android_sdk.zip version, since I don't feel comfortable using installers on Windows systems. However, I understand that I need to set the Home variable in order for the SDKManager.exe to run properly. I tried another method posted on stackoverflow, but if I do that, then both Eclipse and Netbeans, won't find Java anymore.
"C:\Program Files\Java\jdk1.6.0_25\bin';'"
Any ideas?
Thanks!
I believe there may be a bug in the installer for Windows, as I haven't seen it work properly at detecting a JDK on Windows 7 at all.
If you are planning on developing in Eclipse, it isn't even required. You'll save yourself a lot of time and headache if you just download and install the SDK zip file (instead of the installer EXE).
Download and unpack this file somewhere on your machine
Install the ADT plugin into Eclipse
Point ADT to the location you unzipped the SDK in Preferences
HTH

Categories