Cannot launch multiple instances of Eclipse Juno - eclipse

I have multiple Eclipse versions installed in different locations (F:/eclipse-indigo, F:/eclipse-ganymede, F:/eclipse-juno). Indigo and ganymede allow me to launch multiple instances as long as I choose a different workspace. When launching a second instance of Juno I get the error stating "Java was started but returned exit code=1".
I've search for the error but most solutions were for OP not being able to launch Juno at all.
I can launch one instance fine but the second instance doesn't even allow me to choose a different workspace.
Just the error message above.

Try in this order:
Update your Java installation to a recent version. There are bugs in older Java versions causing similar problems: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7002666
Explicitly set the -vm argument in eclipse.ini to point to the Java installation that you want to use (in case there are multiple). Your Eclipse installation currently uses whatever Java was last installed (as that one copied itself into the system32 folder, from where it is started according to the error message).
Compare the eclipse.ini of Juno and one other version. Ignore the DLL and file names, but look if you changed some of the vm options (like memory size) in your old installation. If so, copy those settings into your Juno eclipse.ini.

Have you tried to start Juno explicitly by giving the workspace as argument like in the following shortcut:
F:\eclipse-juno\eclipse\eclipse.exe -data F:\eclipse-juno\ws1
If that does work, there is something wrong (in Juno) with selecting the workspace at the beginning. I try all the time to be explicit with which workspace I want to run Eclipse by creating a batch file or shortcut command like the above.
See this answer for typical command line options.

Related

Setting Up NetSuite IDE in Eclipse

I'm trying to start using the Eclipse IDE for NetSuite SDF, but every time I try to upload or download (or do anything) a script, I'm receiving an error of "javax/xml/soap/SOAPException".
Eclipse Version: 2019-03 (4.11.0) - Eclipse IDE for JavaScript and Web Developers(I've also tried Eclipse IDE for Enterprise Java Developers with the same issue)
I've tried creating a new SuiteScript Project (type 1.0 to start with) called TestScript. I've then created a sample workflow action script.
I've tried connecting to both production and sandbox. Using the Non-2FA Developer role as suggested by SuiteAnswers (70304). I've re-installed Eclipse and the IDE framework (2019.1).
My script looks like:
function sampleFunction(){
nlapiLogExecution('DEBUG', 'Sample', 'Hello world');
}
I'd expect to load this to the file cabinet under SuiteScripts/TestScript, but I'm receiving that SOAPException error instead. I've also tried setting up a TBA authentication for the user, but I receive the same error.
We had this problem on machines with java installed through brew cask. I offer a poor solution, but one that worked for us:
Make sure you have JDK 1.8 installed, and find where it is installed;
Close Eclipse.
Edit your eclipse.ini file (which we found at /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini on our macs)
Enter the following (changed for wherever you found your jdk 1.8 installation) above the existing -vmargs line:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/bin/java
(That's -vm on one line, the path on the next line, the existing -vmargs line below that.)
Restart Eclipse & try again.
Limitations of this solution:
I doubt this updated version of the .ini file will survive Eclipse updates. It'd be great if there was (and there probably is) an .ini file location in the user dir that overrode this one.
Updates to the JDK installation will require manual changes to the .ini file.
… but, it works!

Installing Eclipse without changing the PATH env variable

Is it possible to specify the jvm that the eclipse installer will use? I'm getting the error "Version 1.7.0_67 of the JVM is not suitable for this product. Version: 1.8 or greater is required".
I want to install eclipse oxygen and I have jdk 8, but I don't want to mess with the PATH environment variable that is currently pointing to jre 7, because I fear it may confuse other programs. Is there any way to do this?
Update:
I tried creating an eclipse-inst.ini file as suggested and placed it in the same directory as the installer (note, I didn't edit anything, since there was no existing file).
Tried a number of options for the second line (of course not all at the same time like below):
-vm
C:/zIMC/imc-dev-1.8/jdk8/jre/bin/javaw.exe
C:/zIMC/imc-dev-1.8/jdk8/bin/javaw.exe
C:/zIMC/imc-dev-1.8/jdk8/bin/java.exe
C:/zIMC/imc-dev-1.8/jdk8/bin/
C:/zIMC/imc-dev-1.8/jdk8/jre/bin/server/jvm.dll
Also tried most of them with backslash instead. The last one is from the eclipse.ini of my old installation, which is using jdk7. None of them works, all still give exactly the same message then the installer is run.
I faced the same issue
Download zip version of eclipse,
Once deployed open text file at root folder eclipse.ini
Add the following lines:
-vm
C:/java/jdk1.8.0_144/jre/bin (put correct path for your jvm here)
I added the lines after --launcher.appendVmargs , but i am not sure if that makes any difference.

How do I make eclipse.ini stop changing when I restart eclipse?

I recently installed eclipse Luna for Windows 64-bit. I have the ini file customized. Specifically, I have to set the VM path because the reference to Java on the path is for a different JVM that does not work for eclipse.
Every time I close and reopen eclipse, the vm entry in the ini file is removed, so I have to set it all over again and open eclipse. Is there a setting in Luna to change this?
Eclipse itself doesn't do this; there are plugins which sometimes rewrite the ini file to "fix problems" (usually giving Eclipse more memory) and I've seen cases where Eclipse was started with a script that replaced the ini file with a "known good" copy.
In either case, you will have to examine your installation. Use the "About" dialog to find out which plugins are installed and then find out what they are and what they do. One of them is the culprit.
One way to work around the problem is to create a copy of the file as eclipse.config and use a CMD script to start Eclipse. The CMD script should copy eclipse.config to eclipse.ini and then start Eclipse. That way, anyone can change the INI file but it won't matter.

How to change default JRE for all Eclipse workspaces?

I have one JRE in C:\Program Files (x86)\Java\jre6 and that was the only one at the time I installed Eclipse. I have subsequently installed a complete JDK in C:\home\SFTWR\jdk1.6.0_21 and changed my JAVA_HOME environment variable to that. However, every time I start a new Eclipse workspace, it only picks up the old JRE and I have to manually remove it and add the new one.
How do I bind my Eclipse install to the new JDK so that every new workspace points to that only? I checked eclipse.ini but there was no reference there to which JRE to go to.
UPDATE:
I went into Prefs->Java->Installed JREs, added the new location, marked it as default, removed the other, and it was effective only for the current workspace. However, when I opened a new workspace, only the old JRE was available. So this didn't change the core Eclipse config that is applicable across all (at least new) workspaces
Finally got it: The way Eclipse picks up the JRE is using the system's PATH.
I did not have C:\home\SFTWR\jdk1.6.0_21\bin in the path at all before and I did have C:\Program Files (x86)\Java\jre6\bin. I had both JRE_HOME and JAVA_HOME set to C:\home\SFTWR\jdk1.6.0_21 but neither of those two mattered. I guess Eclipse did (something to the effect of) where java (or which on UNIX/Linux) to see where Java is in the path and took the JRE to which that java.exe belonged. In my case, despite all the configuration tweaks I had done (including eclipse.ini -vm option as suggested above), it remained stuck to what was in the path.
I removed the old JRE bin from the path, put the new one in, and it works for all workspaces.
The Installed JREs is used for what JREs to execute for your downstream Java projects and servers. As far as what JVM or JRE that is used to execute Eclipse process (workbench) itself that is controlled by your environment, history and eclipse.exe binary. So eclipse.exe itself decides what JRE Eclipse will execute itself with, not installed JREs preferences since those are not read until OSGi framework is up and running which is loaded after the JVM/JRE is picked.
So for new workspaces, Eclipse is going to use its currently executing JRE to populate the JRE prefs.
The best way I know how is to force eclipse.exe to use the JRE that you tell it via the -vm switch. So in your eclipse.ini do this:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-vm
/path/to/exactly/what/jre/you/want/as/default/javaw.exe
...
Open the Java > Installed JREs preference page. Check the box on the
line for the JRE that you want to assign as the default JRE in your
workbench. If the JRE you want to assign as the default does not
appear in the list, you must add it. Click OK.
Source-http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-assign_default_jre.htm
In eclipse go to
Window-> Java -> Installed JREs
You can remove your current installed jre and add the jdk by specifying the path to where the jdk is installed.
I ran into a similar issue where eclipse was not using my current %JAVA_HOME% that was on the path and was instead using an older version. The documentation points out that if no -vm is specified in the ini file, eclipse will search for a shared library jvm.dll This appears in the registry under the key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment that gets installed when using the windows java installer (key might be a bit different based on 64-bit vs 32-bit, but search for jvm.dll). Because it was finding this shared library on my path before the %JAVA_HOME%/bin, it was using the old version.
Like others have stated, the easiest way to deal with this is to specify the specific vm you want to use in the eclipse.ini file. I'm writing this because I couldn't figure out how it was still using the old version when it wasn't specified anywhere on the path or eclipse.ini file.
See link to doc below:
http://help.eclipse.org/kepler/topic/org.eclipse.platform.doc.isv/reference/misc/launcher.html?cp=2_1_3_1
Finding a VM and using the JNI Invocation API
The Eclipse launcher is capable of loading the Java VM in the eclipse process using the Java Native Interface Invocation API. The launcher is still capable of starting the Java VM in a separate process the same as previous version of Eclipse did. Which method is used depends on how the VM was found.
No -vm specified
When no -vm is specified, the launcher looks for a virtual machine first in a jre directory in the root of eclipse and then on the search path. If java is found in either location, then the launcher looks for a jvm shared library (jvm.dll on Windows, libjvm.so on *nix platforms) relative to that java executable.
If a jvm shared library is found the launcher loads it and uses the JNI invocation API to start the vm.
If no jvm shared library is found, the launcher executes the java launcher to start the vm in a new process.
-vm specified on the command line or in eclipse.ini
Eclipse can be started with "-vm " to indicate a virtual machine to use. There are several possibilities for the value of :
directory: is a directory. We look in that directory for:
(1) a java launcher or
(2) the jvm shared library.
If we find the jvm shared library, we use JNI invocation. If we find a launcher, we attempt to find a jvm library in known locations relative to the launcher. If we find one, we use JNI invocation. If no jvm library is found, we exec java in a new process.
java.exe/javaw.exe: is a path to a java launcher. We exec that java launcher to start the vm in a new process.
jvm dll or so: is a path to a jvm shared library. We attempt to load that library and use the JNI Invocation API to start the vm in the current process.
My answer will overlap with amphibient's while adding on to it.
Your JAVA_HOME variable is fine, but you also need to append the following to your Path variable :
;%JAVA_HOME%\bin
This will allow your applications in your Windows environment to access your JDK. You should also restart your computer once you've added these environment variables before checking out if they work. In my case, even logging out and then back in didn't work : I had to completely restart.
If you want to check if the environment variables are set correctly, you can open up a command prompt and type >echo %JAVA_HOME and >echo %Path% to see if those variables are working correctly. While snooping around for solutions, I have also run into people claiming that they need to add quotations marks (") around the environment variables to make them work correctly ("%JAVA_HOME%"\bin) if your JAVA_HOME path includes spaces. I thought that this was my case at first, but after doing a full restart my variables seemed to work correctly without quotation marks despite the spaces.
when you select run configuration, there is a JRE tap up next the main tap, select "Workspace default JRE(JDK1.7)".
Be sure to use the jdk in Prefs->Java->Installed JREs ->Execution Environment
I have faced with the same issue. The resolve:
- Window-->Preferences-->Java-->Installed JREs-->Add...
- Right click on your project-->Build Path-->Configure Build Path-->Add library-->JRE system library-->next-->WorkSpace Default JRE
try to change the order:
right click on you project-> BuildPath->Configure...->Order and Export tab -> move jre7 UP.
I navigated to:
Eclipse>Pref>Java>Installed JRE>Search...
2 of them popped up and I checked the latest one. Before I did this I also went to About>Check for Updates and updated it. I didn't have to reinstall any JRE or JDK either. I might have done it a while back, except it was with 1.6 not 1.4. Hope that helps!
On windows I've tried different approaches
- setting JAVA_HOME, JRE_HOME and extending the PATH to point to the desiered jre18 but nothing helped
- disabling the JRE17 in the java control panel didn't helped either
What helped me out was to force eclipse to use the appropriate JRE in the eclipse.ini file e.g.
-vm
C:\java\jdk1.8.0_111\jre\bin\javaw.exe
#Stefan Michev answer also worked for me,
edit eclispe.ini to point to your installed JRE
-vm
C:\Program Files\Java\jdk-18.0.1.1-openj\bin
but to elaborate;
My application server uses JAVA_HOME and thus PATH so I needed Eclipse to pick up another JRE to run (so to be compatible with an installed plugin).
This Eclipse JRE is different than
than setting Window-> Preferences -> Java -> Installed JREs which as you see in the below image, is for building Java projects, so you can have different projects with different JDKs
Eclipse Installed JREs

Does Eclipse store any information out of its directory?

I have used Eclipse Indigo (C/C++) for sometime along with PyDev Plugin (for Python). As I messed up with the IDE (tried to tweak some core files, for fun!), I thought to install a fresh one and this time I downloaded Eclipse Indigo (for Java).
Eclipse (C/C++) was placed in C:/
Eclipse (Java) was even placed in C:/
Now when I opened Eclipse (Java), I observed two things:
The Eclipse's title bar still showing <C/C++ Eclipse>
There was a python's project file still opened up which I worked on Eclipse C/C++ IDE. Also, there was an PyDev's error popped up (mentioning it wasn't installed).
I have verified "Installed Plugins" list and didn't find any plugin related to C/C++ or python.
Now, I have got one question:
As I searched over google and found that Eclipse doesn't store anything beyond its directory, How does this above things are showing up??
There might be some Temp/ Cache files stored. However, I searched my drive with "Eclipse" and "PyDev" as keywords and found nothing.
I even searched for registry keys but couldn't find anything.
What exactly is happening and how do remove Eclipse completely?
TL;DR: using the new Eclipse (Java), select "File > Switch Workspace... > Other...", and create a new directory (e.g. java-wks) for all projects you will do using the new Eclipse.
The long explanantion is that Eclipse stores data in two locations:
The eclipse installation directory itself: contains the plug-ins you install (including the ones already installed in the package you downloaded) and some runtime configuration parameters (see eclipse/config.ini) related to how Eclipse itself should run (e.g. where to find the JRE to execute Eclipse itself, how much memory to allocate etc.)
The workspace(s), where your data (projects and source code) and all personal configuration parameters are stored. This is where Eclipse remembers where your source code is, which file(s) where opened when you last exited, which perspective was active (in your case C/C++ Eclipse), your preferences, launch configurations, breakpoints, etc.
For each Eclipse installation on your system (eclipse folder), you can have as many workspaces as you want (it helps to isolate work). There are various ways to select the workspace location: using the -data <path-to-workspace> option on the command-line, using the popup Eclipse normally shows when starting up (but you may have disabled it), or using "File > Switch Workspace...".
You can also use the same workspace from different Eclipse installations (though not at the same time), but things will not work well if you have different plug-ins installed in each: if one installation stores in the workspace "this is a Python project, and the current perspective is C/++", and the other installation does not have the Python and/or C++ plug-ins installed, it will not known what to do with these info. This is why you see the errors you reported.
For your case, my guess is that under Windows the default workspace location is somewhere in your home directory, and the new (Java) Eclipse is using that, but failing to make sense of the Python and C++ related preferences and projects the previous Eclipse stored there. You need to use a fresh workspace not "polluted" with Python and C++ stuff if you want the Java Eclipse to work without errors (or install the Python and C++ plug-ins in the new Eclipse). You may want to enable the Prompt for workspace on startup preference (in "General > Startup and Shutdown > Workspaces") if it is not to control this easily each time Eclipse starts.