views:

222

answers:

5

I usually do all my java development on linux, using fedora package manager setting up a development environment is easy and fast.

Now I have to start using windows but I never used it for java development and im having a few difficulties having it setup.

So I downloaded and installed thye java 6 JDK (just the standard edition, not the EE) and installed it.

Next I downloaded eclipse classic package, which doesnt have an installer, you just unzip it and run it.

I had to add the java bin directory to the PATH variable, which I did.

But when I start eclipse.exe I get this:

alt text

http://img02.imagefra.me/img/img02/1/12/12/f_12c33ivd2m_c79c09f.jpg

I already made a new environment variable called CLASSPATH and add the d:/java sdk/lib directory to it, but it the same thing. Am I missing something?

Thanks.

UPDATE: so i wrote the path to the java.exe on the eclipse.ini file (linking to jvm.dll didnt work) and now it just opens a console window for a few seconds and then closes (doesnt output anything).

also launching it like: java -jar plugins/org.eclipse.equinox.launcher_1.0.0.v20070208a.jar make the vm work for about 1-2 seconds and then it returns, with no outputs.

UPDATE2: i didnt know it was writting a log file, found it and read it and it said i was using GWT x32 libraries on a x64 VM, so i just downloaded an eclipse x64 version and it worked. i still had to use the .ini trick to say where the JVM is installed.

thanks a lot for the help.

A: 

Try setting the JAVA_HOME variable in your system environment variables to point to where your JDK is installed. You might need to point it to the jre subdirectory (in the JDK kit) if that does not work.

Francis Upton
A: 

Perhaps the blank in d:/java sdk/lib does cause the problems. You should try to rename the directory.

tangens
Or make sure, that the path variable entry is like `D:\"java sdk"\bin` (not lib!!)
Andreas_D
+3  A: 

Try referencing the JVM in the eclipse.ini setting file, rather than an environment variable.
See this eclipse.ini

-vm
c:/path/to/your/jdk1.6.0_17/jre/bin/client/jvm.dll

See Finding a VM, Using JNI Invocation or Executing Java on the eclipse wiki for more


Here is a copy of a more general answer (since then deleted) on Eclipse installation:

Having a simple JRE is enough for eclipse to run.
Eclipse will try to launch with the default "java.exe" (the first one referenced by your PATH)

Three things to remember:

  • "installing" a JRE or a JDK can be as simple as unzipping or copying it from another computer: there is no special installation steps, and you can have as many different JVM versions (1.4, 5.0, 6.0...) as you want, "installed" (copied) almost anywhere on your disk.
  • the JVM you will reference within your Eclipse session is not always the one used for launching Eclipse because:
    • you only need a JRE to launch Eclipse, but once Eclipse launched, you should register a JDK for your projects (especially for Java sources and debugging purposes, also in theory for compilation but Eclipse has its own Java compiler)
      Note: You could register just a JRE within Eclipse because it is enough to run your program, but again a JVM will allow for more operations.
    • Even though the default registered Java in Eclipse is the one used to launch the session, you can want to register an older SDK (including a non-Sun one) in order to run/debug your programs with a JRE similar to the one which will actually be used in production.
  • I would recommend to always run Eclipse with the lastest JRE possible (to benefit from the latest hotspot evolutions). You can reference that in your eclipse.ini.

alt text

VonC
ok, linking it to the .dll on the eclipse.ini file didnt work, but linking the java.exe path KINDA works. now it doesnt give an error, it just opens a console window, doesnt output anything and then closes :|
sap
+1  A: 

If available under the eclipse/jre directory, the Eclipse JRE will be used; otherwise the launcher will consult the system path variable. Eclipse will NOT consult the JAVA_HOME environment variable.

In your case, I suspect the system path to be incorrectly set (because of a space in the path to the Java binaries for example). Does this work?

C:> java -version

Could you update your question with the content of your PATH?

c:> path
c:> set path
Pascal Thivent
c:> java -versionoutputs version, so i guess having blank spaces on the PATH variable works, but i still had to add the java.exe path to the eclipse.ini file for it to find it.
sap
Humm... I still think that Eclipse is somehow annoyed by the space (can't cross check, I'm not using Windows) as you shouldn't have to mess with `eclipse.ini`. Does it help if you use DOS short (8.3) filename which must be `d:/javasd~1/bin` in the PATH?
Pascal Thivent
A: 

A simple workaround: create a directory names 'jre' directly under 'eclipse' and copy the jre files into that directory, so that it looks like:

.../eclipse
          /features
          /jre
              /bin
                  /java.exe
          /plugins

(most files are missing in this tree, it't just to give you an idea)

Eclipse should start with the java runtime located in that folder.

Andreas_D