5

Here is my question i installed Java Plugin for Chrome it does mean i have installed java in my machine...And after installing this plugin can i run below command

java -jar myfile.jar

through a batch file or i have to install java in my machine and setup class-path then it should work?

If i will install Java browser plugin it automatically installed java in my machine and setup path as well.

Its hard for me t understand the situation how it works. Can anyone help me on this?

2
  • Y is this not relates with this website? Commented Jan 13, 2014 at 10:51
  • 1
    Please note that... When you say Java, we assume JDK.. Be more specific, JDK/JRE. Also, your java -* cmd is based on JRE not JDK.. Commented Jan 13, 2014 at 10:52

2 Answers 2

1

The JRE is the Java Runtime Environment, i.e. the software you need to interpret and execute Java class files. The Java browser plugin is the bridge between the JRE and the browser, used to run Java classes of applets embedded in HTML.

You can check the Java plugin of Chrome browser in this link.

The plugin is bundled with the JRE, and runs inside a browser, allowing Java code to run inside the browser process on the client. The main entry point class must be written as an Applet when the plugin is used, but all the Java code it calls can be just regular Java.

There are limitations when running Java code with the Java plugin for security reasons. All code shall run within sandbox with limited access to the file system and such.

Also as the plugin check for installed JRE version at your machine, that means you do have JRE. You can install as many JDKs as you like. Just put them in different folders.

The one you refer to on the path is your choice - but presumably you'd choose the one that you want to use whenever you type "java ...." commands at the command line. In the absence of any other factors you should probably set this to be your most recent JDK version.

Note that your IDE may support multiple JDKs, for example Eclipse has "Preferences / Java / Installed JREs" where you can set up multiple JDKs/JREs for use with Eclipse

Sign up to request clarification or add additional context in comments.

1 Comment

java - (my commands use jre only); you can check the version available at your machine by using. "java -showversion" command.
0

Please first check your machine contains java (jdk or jre)

java -version -- if you get a valid output then you have java in your machine.

in order to run java -jar myfile.jar , you should install java (jre or jdk) in your machine and class path set to the relevant location. To run this you should install jdk or jre in your machine. Most program only need the JRE (Java Runtime Environment) but some programs need the Compiler at runtime in which case you need the JDK.

Please refer this link to find out How to set class path . Then you will be able to run your command.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.