Bug 9027 - [Serviceability] Workbench should check JDK version on startup
Summary: [Serviceability] Workbench should check JDK version on startup
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P1 normal (vote)
Target Milestone: 2.0 F3   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 9154 18962 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-02-04 09:57 EST by Nick Edgar CLA
Modified: 2002-06-13 19:46 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-02-04 09:57:36 EST
Build 20020129

From the newsgroup, here's an example of a startup problem which could be
better handled by eclipse.
It should check the jre/jdk version first.
Since this can't be done in eclipse.exe, since you have to be running Java in 
order to determine the version, we should do it in the workbench on startup.


"Darin Wright" <darin_wright@oti.com> wrote in message
news:<a2hv80$fmv$1@rogue.oti.com>...
> The error message:
>
> > 4 org.eclipse.jdt.ui 1 Internal Error
> > java.lang.reflect.InvocationTargetException:
> > java.lang.NoSuchMethodError
>
> indicates to me that you are running Eclipse on a JDK1.2.x VM. You need to
> run Eclipse on JDK1.3. Eclipse itself no longer runs on 1.2.x, as we rely
on
> 1.3 APIs.
>
> The errors with ProcessView are expected, as the ProcessView has been
> removed. Please see the latest Platform Debug Build Notes.
>
> Darin
>
> "Michael Moser" <nospam-mmo@zurich.ibm.com-nospam> wrote in message
> news:a2htv8$f9f$1@rogue.oti.com...
> > Hi folks,
> > I just downloaded and installed the last integration build. When I now
> > want to run or debug a program I get an error popup "Launching
> > failed - See error log for more details."
> >
> > The error log reads as follows:
> > --------------------------------------------------
> > Log: Mon Jan 21 20:42:44 GMT+01:00 2002
> > 1 org.eclipse.core.resources 4 Could not create view:
> > org.eclipse.debug.ui.ProcessView
> > Log: Mon Jan 21 20:42:44 GMT+01:00 2002
> > 1 org.eclipse.core.resources 4 Could not create view:
> > org.eclipse.debug.ui.InspectorView
> > Log: Mon Jan 21 20:42:48 GMT+01:00 2002
> > 1 org.eclipse.core.resources 4 Could not create view:
> > org.eclipse.debug.ui.ProcessView
> > Log: Mon Jan 21 20:42:48 GMT+01:00 2002
> > 1 org.eclipse.core.resources 4 Could not create view:
> > org.eclipse.debug.ui.InspectorView
> > Log: Mon Jan 21 20:47:26 GMT+01:00 2002
> > 4 org.eclipse.jdt.ui 1 Internal Error
> > java.lang.reflect.InvocationTargetException:
> > java.lang.NoSuchMethodError
> >  at
> > org.eclipse.jdt.internal.debug.ui.launcher.JDKDebugLauncher.run(JDKDeb
> > ugLauncher.java:119)
> >  at
> > org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLauncherDele
> > gate$1.run(JavaApplicationLauncherDelegate.java:167)
> >  at
> > org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalC
> > ontext.java:98)
> > Log: Mon Jan 21 21:18:13 GMT+01:00 2002
> > 4 org.eclipse.jdt.ui 1 Internal Error
> > java.lang.reflect.InvocationTargetException:
> > java.lang.NoSuchMethodError
> >  at
> > org.eclipse.jdt.internal.debug.ui.launcher.JDKLauncher.run(JDKLauncher
> > .java:68)
> >  at
> > org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLauncherDele
> > gate$1.run(JavaApplicationLauncherDelegate.java:167)
> >  at
> > org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalC
> > ontext.java:98)
> > --------------------------------------------------
> >
> > There were a couple of initial error messages after I had installed
> > the new version and had copied over the .metadata and the workspace
> > directory and then launched the new version for the first time.
> >
> >
Comment 1 Eduardo Pereira CLA 2002-02-04 10:52:36 EST
Should this be done in the UI or Core?
Comment 2 Nick Edgar CLA 2002-02-04 11:52:26 EST
I'm assuming UI since we're the first application to run.
It would make sense for core.runtime to know which versions are good, however 
it can't present a UI if the test fails.
Comment 3 Eduardo Pereira CLA 2002-04-12 14:26:59 EDT
Need API from Core returning the JDK versions that can be used.
Once we have the API, we can open a dialog warning the user.

Moving to Core for comments.
Comment 4 John Arthorne CLA 2002-04-25 18:24:26 EDT
*** Bug 9154 has been marked as a duplicate of this bug. ***
Comment 5 DJ Houghton CLA 2002-05-23 15:22:59 EDT
Investigate for 2.0.
Comment 6 DJ Houghton CLA 2002-05-28 11:41:39 EDT
After discussions with other, have decided that this must be checked before 
the UI is around since there could be differences in the class loader, etc.

Recommend making the change in the Main.java.
Comment 7 DJ Houghton CLA 2002-05-30 14:50:47 EDT
Adding McQ and KC to CC for changes in executable.

Recommend we have a special return code which informs the user that they need 
to run with a VM with a newer version.

Recommend that the return code be "14".
Comment 8 Mike Wilson CLA 2002-05-30 15:01:19 EDT
I'm assuming KC will handle this.
Comment 9 Kevin Cornell CLA 2002-05-30 15:04:25 EDT
The main launcher detects the JVM terminates with exit code 14. Is the 
following message sufficient?

    Please use a newer VM. Eclipse requires at least 1.3.1.
Comment 10 Kevin Cornell CLA 2002-05-30 16:08:02 EDT
Launcher changes have been committed. Error message is as above.
Comment 11 DJ Houghton CLA 2002-05-31 23:47:49 EDT
My apologies, I thought that it should be 1.3.1 until I double-checked tonight 
before releasing and realized that the project plan says 1.3.0.

Changing the code in Main.java to accept at least 1.3.0 VM and querying to see 
if the project plan is true or out of date.

Keeping bug open until required version issue is resolved.

If 1.3.1 is minimum then I will change Main.java.
If 1.3.0 is minimum then error message should be changed.

Sorry for not confirming this sooner.
Comment 12 DJ Houghton CLA 2002-06-02 17:09:23 EDT
Backing out of this change for now due to bug 18635.
Will determine which System property is correct.

Note that IBM and Sun return "1.3.0" for "java.vm.version" but J9 returns "15" 
so this presumably can be an internal number.
Comment 13 DJ Houghton CLA 2002-06-02 17:10:52 EDT
See bug 18635 for a list of J9's System.getProperties() on Photon.
Comment 14 Mike Wilson CLA 2002-06-03 08:42:39 EDT
You need to check "java.version", not "java.vm.version".
Comment 15 Kevin Cornell CLA 2002-06-03 15:36:41 EDT
What is the net result of the required version issue.
1). Is eclipse still checking the JVM version and returning exit code 14 if the 
version is too old?
2). If exit code 14 is returned, should the launcher message indicate the 
required version should be at least 1.3.0 or 1.3.1?
Comment 16 DJ Houghton CLA 2002-06-03 15:47:20 EDT
I believe that the code and message will remain as is. Its not a P1 so it 
won't change. Net result is:

- 1.2.2 VM -> user gets message to upgrade to 1.3.1
- 1.3.0 VM -> Eclipse starts
- 1.3.1 VM -> Eclipse starts
Comment 17 Wolfgang Frech CLA 2002-06-04 03:15:55 EDT
What is the intended behavior on a 1.4 VM?

Feature request 9154 was: check if VM is supported, unsupported, or unknown;
display a warning if not supported; try to start anyway.

Resolving bug 6587 as invalid because of unsupported VM could have been easier
if the Eclipse platform had displayed a warning, instead of starting up, and
terminating later at the first Java compile, both without any message.

Both bugs are effectively folded into this thread.
Comment 18 DJ Houghton CLA 2002-06-04 11:28:27 EDT
*** Bug 18962 has been marked as a duplicate of this bug. ***
Comment 19 DJ Houghton CLA 2002-06-04 11:32:40 EDT
The intent is for Eclipse to start with a 1.3.0 or greater VM and fail (with a 
message to the user) otherwise.
Comment 20 Wolfgang Frech CLA 2002-06-05 03:58:00 EDT
Does Eclipse run ok on a 1.4 Java environment?  My observation in bug 6587 was:
with Sun's 1.4 it did not, with 1.3 the problem did not occur.  As I read the
test reports, nobody tests against 1.4.
So what is the intended behavior for Eclipse starting on a 1.4 environment?
I propose: warn the user and try to start.  As TeX says: "Proceed with fingers
crossed." 
Comment 21 Michael R. Head CLA 2002-06-05 11:24:01 EDT
I would like to add in here that the following JVM (from blackdown's debian
packages) fail:

java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-FCS)
Java HotSpot(TM) Client VM (build Blackdown-1.3.1-FCS, mixed mode)

While this following JVM (Sun's 1.4.0 for linux) works perfectly:
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

As would be expected, the IBM 1.3.1 JVM for linux works fine as well:
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1)
Classic VM (build 1.3.1, J2RE 1.3.1 IBM build cxia32131-20020410 (JIT enabled:
jitc))

(I am running debian sid/unstable)

mike
Comment 22 DJ Houghton CLA 2002-06-05 12:41:42 EDT
Kevin, can we change the executable's message to print out 1.3.0 instead of 
1.3.1? This would bring it in line with the code which is checking 
compatibility.
Comment 23 Kevin Cornell CLA 2002-06-05 14:45:40 EDT
The launcher's error message has been changed to:

    Please use a newer VM. Eclipse requires at least 1.3.0.



Comment 24 DJ Houghton CLA 2002-06-06 17:43:46 EDT
Fixed. Reviewed. Released.
Tested against 1.2.2, 1.3.0, 1.3.1, 1.4, and 1.4.1 VMs.
Also tested against J9 (WinXP and Photon)
Closing.
Comment 25 Nick Edgar CLA 2002-06-13 16:40:52 EDT
Also verified by Adam S in F3.
Comment 26 Michael R. Head CLA 2002-06-13 19:46:15 EDT
F3 works, even in my weirdo debian/blackdown configuration, cheers!