0

I downloaded scala ide, but it won't run. It gives me this error:

enter image description here

but my java location is C:/jdk.

I do have JAVA_HOME installed and pointing to C:/jdk.

how to make eclipse look to the right location for scala eclipse ide to run?

ERJAN
  • 23,696
  • 23
  • 72
  • 146
  • @LuisMiguelMejíaSuárez, thx u, now i will try to do my project using visual studio code – ERJAN Jul 05 '20 at 21:08
  • 2
    **VSCode** is great but for a proper **Scala** development you would need to use it with [**metals**](https://scalameta.org/metals/) & [**bloop**](https://scalacenter.github.io/bloop/) which is a great setup _(it is my setup btw)_, but I do not know how well it performs on Windows. I would recommend you to use **WSL 2** _(that is what I do)_. – Luis Miguel Mejía Suárez Jul 05 '20 at 21:26
  • @LuisMiguelMejíaSuárez Please do not advertise commercial products regardless of whether you get money for doing so or not. – howlger Jul 06 '20 at 09:46
  • 1
    @howlger I am not advertising anything. As I already said, the **ScalaIDE** is deprecated and has been deprecated since like 2 years ago. There is no point in making it start, the development experience will not be good, the IDE crash several times, you get bad error messages, it won't work with newer Scala versions at all, etc _(btw, I am talking about experience, I used it for like 3 years)_. So I just suggested OP an alternative _(an alternative that BTW I do not like, but that is one of the most popular ones according to the community)_. – Luis Miguel Mejía Suárez Jul 06 '20 at 13:05
  • @LuisMiguelMejíaSuárez In your first comment, how can the second sentence be read in a different way than not advertise a commercial product? Please note, recommend a tool is off-topic on Stack Overflow. – howlger Jul 06 '20 at 14:05
  • @howlger as a simple suggestion? I did not say it was better, I did not put a whole paragraph about its features, I just say that OP would want to give a look to some tool. Put in another way, I told OP that his/her choice is deprecated and won't work, naturally, a follow-up question would be an alternative so I just included in my comment a simple suggestion _(which, I repeat, I really do not like but is a popular one)_. Anyways, if you still consider the comment is wrong feel free to report it. – Luis Miguel Mejía Suárez Jul 06 '20 at 14:36

2 Answers2

1

You have a 64 bit Eclipse (x86_64) that does not work with the 32 bit Java (Program Files (x86)) you have.

To run that Eclipse you need a 64 bit Java, which can be specified in the eclipse.ini.

howlger
  • 31,050
  • 11
  • 59
  • 99
  • can u help with changing eclipse.ini file? i changed it and added the arg -vm C:/java/jdk/bin/javaw.exe, but it still gives me error – ERJAN Jul 06 '20 at 16:25
  • "error - could not create the java virtual machine" – ERJAN Jul 06 '20 at 16:26
  • In the `eclipse.ini` add above the line `-vmargs` the two separate lines `-vm` followed by `C:/java/jdk/bin/javaw.exe`. Alternatively (not having these lines), in the Eclipse installation directory you can create a subfolder `jre` with a Java 8 JRE or JDK (e.g. from [AdoptOpenJDK](https://adoptopenjdk.net/?variant=openjdk8)). – howlger Jul 06 '20 at 17:02
0

alright, after soooo much struggle I found a solution - i made eclipse launch with this trick. @howgler - from the previous comment gave me link to Adopt open jdk

I never heard of it before, but it's just another opensource jdk\jre build.

  • I selected windows x64
  • installed the openJDK.
  • changed the JAVA_HOME env var to C:\openjdk\jdk8025209hotspot - no spaces.
  • reload the computer

No need to mess with eclipse.ini file, i just deleted all that "-vm stuff" and made it work with adopt_open_jdk

ERJAN
  • 23,696
  • 23
  • 72
  • 146