

- HOW TO RUN CODE SUBLIME TEXT WINDOWS HOW TO
- HOW TO RUN CODE SUBLIME TEXT WINDOWS 64 BIT
- HOW TO RUN CODE SUBLIME TEXT WINDOWS WINDOWS 7
Write your own batch file to build all source files in the current directory: If the JDK/bin location is included in System PATH, then javac will compile that file.Ģ. the java compiler is called on the current file name (M圜lass.java). Therefore when we set Tools -> Build System to JavaC and run Tools -> Build/ Ctrl+B from a source (say M圜lass.java), the command invoked is javac, i.e. The java build config file has by default 3 key-value pairs as shown below: So for example, the java build config file is in C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\Java\JavaC.sublime-build. Any build config file can be found in the respective language folder here.
HOW TO RUN CODE SUBLIME TEXT WINDOWS WINDOWS 7
These configuration files use JSON like key-value pairs and are found in Preferences -> Browse Packages folder (in Windows 7 it is at C:\Users\user\AppData\Roaming\Sublime Text 2\Packages). Sublime Text 2 comes with build config included for most popular languages like C++/ Java, as long as the compiler locations are included in System PATH.
HOW TO RUN CODE SUBLIME TEXT WINDOWS 64 BIT
So if we use 64 bit JDK to compile the code and we have a lower version 32 bit JRE also installed, then the compiled class will be run on this older JRE and we’ll get Better is to disable older JREs if not required.


If both 64 bit and 32 bit JREs co-exist in a system, then by default it selects 32 bit JRE to run the application. To know your JRE version and whether 32/ 64 bit, open a cmd prompt and type java -version. Ensure that the JRE and JDK versions match, else the compiled classes would not run. Here is what we need to do to get started quickly:ĭefault location of JDK in Windows 7 is C:\Program Files (x86)\Java\jdk1.7.0_13\bin.Īdd this location (or whatever it is in your case) at the end of current System PATH (if other JDKs are installed, put the one to be used before others in the PATH).įor 64 bit JDK, we need to put the corresponding JDK/bin instead (default: C:\Program Files\Java\jdk1.7.0_13\bin). Who wants to launch Eclipse to create a Hello World program (or say a programming assignment at an online course)? Sublime Text 2 is the answer. In that case you need to modify the command you give to cmd to get it to also wait until you press a key.Sublime Text 2 is the latest craze in text editors, and it can be customized to such extent that it has the potential to perform as a light-weight IDE. You could add -i to the python command to get it to go interactive, but then you'd have to interact with the internal python REPL in order to get it to quit and close the window, which it sounds like you don't want to have to take the step to do. The result of that is that as soon as your program is finished, the window immediately vanishes before you can see what it did. Similarly, Python also quits when the program is finished. There are some general issues with this the biggest one is that as soon as cmd finishes executing the command you give it, it quits.

That tells start to launch a new instance of cmd, which you're telling to run the program, so now the Python program is running in its own window. The general format of that would be something like this: start "" cmd /s /c python my_file.py In order to run the program in a new window, you need to use the start command, which launches a new program. you're telling cmd to run a command, but it's still running in the current window, which is not what you want. However if you do that in an existing command prompt, the result is just to run the program in the current window i.e. In your case you want to use Python to execute a program, so that might look something like the following to get Python to execute my_file.py. In Windows, you can use a terminal command like cmd /s /c something to tell the Windows cmd.exe that it should execute the command something.
HOW TO RUN CODE SUBLIME TEXT WINDOWS HOW TO
In this case, what you want to do is spawn a new cmd window and do something inside of it the fact that you're using Sublime is thus not interesting in the grand scheme of knowing how to do that, which might be why your search didn't turn up any results. The rule of thumb for build systems in Sublime Text is that if you can craft a command line that, when executed manually in the terminal/console, will give you the effect that you want (and that command doesn't require interactive input), then you can turn it into a build system.
