java_on_windows_path

When I run win_run.bat in Windows, it briefly generates a DOS window

in which some lines quickly appear before the window closes and

nothing more happens. What should I do?

If I copy the content of win_run.bat into a DOS window and run it from

the directory into which I extracted MathPiperIDE, then I see an

exception as shown below.

C:\Program Files\MathPiperIDE\

mathpiperide>java -Duser.home=. -Xms256M

-Xmx512M

-classpath ./jedit.jar;./jars/geogebra.jar;./jars/geogebra_cas.jar;./

jars/geogeb

ra_export.jar;./jars/geogebra_gui.jar;./jars/geogebra_main.jar;./jars/

geogebra_p

roperties.jar;./jars/geogebra_javascript.jar org.gjt.sp.jedit.jEdit -

noserver -s

ettings=./settings

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/

gjt/sp/je

dit/jEdit (Unsupported major.minor version 49.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

-------

It does indeed seem like an older version of Java is being executed in

your DOS shell. The first thing you should do is to open a DOS shell

and find out what version of Java you are running with the following

command:

C:\>java -version

java version "1.6.0_17"

Java(TM) SE Runtime Environment (build 1.6.0_17-b04)

Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode,

sharing)

Your Java version should be 1.6+

If you installed Java 6 but a lower version of Java is reported, then

the "path" environment variable for your DOS shell may have an older

version of Java listed in the path. In Windows XP, can check your

"path" variable like this:

1) Select: Start -> Control Panel.

2) Switch to "Classic View" if it is not already in "Classic View".

3) Select: System -> Advanced -> Environment Variables.

4) The "path" variable is in the the System Variables section of the

Environment Variables dialog,

This is very helpful. Although the java web site says I'm running Java

v6 update 18 and although I reinsllaed Java and the web site still

says I have v6, your java -version says I have 1.3.1_01.

I checked my path environment variable and the relevant parts seem to

include C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:

\Program Files\Oracle\jre\1.1.8\bin;C:\

Program Files\QuickTime\QTSystem

\. Presumably the java in C:\program files\Oracle\jre\1.3.1\bin is

being picked up. (I didn't even know that was there; I'd only been

looking at Java versions in C:\program files\java).

Do I now need to change my path? And do I simply add a path for 1.6 or

might the Oracle version still get picked up? (Would I need to remove

the Oraclee entries for Java?)

And if I add the 1.6 path, might this mean any parts of my system get

out of synch with each other - something presumably put an Oracle java

on my PC and I don't want to break whatever that something is.

------

The parts of the path that are causing the problems are these:

C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;

The bin directory in both of these paths contain a java.exe executable

file and the first one that is listed on the path is the one that is

being run in your DOS shell. Here are some ways to fix this problem:

1) Simply remove these paths from your "path" environment variable if

you think that these old versions of Java are not being used anymore

(which there is a good chance that they are not).

2) Edit the win_run.bat file and add the full path to the version of

Java you want to run. For example, on my Windows system I added the

following complete path to my Java 6 installation:

"C:\Program Files\Java\jre1.6.0_07\bin\

java" -Duser.home=. -Xms256M

-Xmx512M <snip>

Your version of Java should be in a similar place.