0

I need help with getting path to java.exe. But I need it to do with java code. And I want it to work on Linux and Mac and on other systems too, so there won't be java.exe, I don't know what's there.

Does anyone know how to do it? Thanks.

vrbadev
  • 455
  • 1
  • 7
  • 20
  • 2
    *Why* do you need to do that? [What is your real problem?](http://mywiki.wooledge.org/XyProblem) – thkala Mar 09 '13 at 11:20
  • Are you trying to run a `.jar` or `.class`? Because there are **much** better ways of doing that. – tckmn Mar 09 '13 at 12:42

1 Answers1

-2

Take a look at this post. Get path to the JRE

It explains how to get the path of where your java.exe bin/java file lies on your OS.

Also see the docs for more properties that are available

Java System.getProperty docs

Community
  • 1
  • 1
Cobolt
  • 935
  • 2
  • 11
  • 24