- #Compiling java classes with text editpr 64 Bit#
- #Compiling java classes with text editpr full#
- #Compiling java classes with text editpr windows 7#
We copy the batch file to the same location as javac (i.e. Put your batch file in JDK/bin directoryĪll we need now is to call our batch file instead of javac in the build config. We don’t need to specify extension (just class name is sufficient), so we use the var n1 instead of nx1.ģ. This ensures the second condition passes and now we run M圜lass.class file using java command. Then we use javac to compile/ rebuild that directory. Next we check for all existing class files (the wildcard ‘*’ ensures this) in the same folder and if exist, delete all of them. So the first line will echo “Compiling M圜lass.java” on the output panel.
#Compiling java classes with text editpr full#
We refer to the full name of file with nx1, and excluding extension with n1 (i.e. The class in this file is also the entry point of our executable. When Ctrl+B /Tools -> Build is invoked, the current file is passed as argument to our batch file and compilation starts.
![compiling java classes with text editpr compiling java classes with text editpr](https://1.bp.blogspot.com/-tE0Nf5UV_g4/Xx234Ghx2_I/AAAAAAAABbM/uVG7A0LKmhkrQpyvNJR5uQwf1xDgAEk_QCLcBGAsYHQ/s1600/decoder.jpg)
This file takes in an argument that it refers as nx1 (1: first arg). For basic compiling and running java code, we can create a batch file say runJavaST2.bat (Windows/ MS-DOS) as OFF We can write our own batch file and call that instead of javac, and in this batch file we can specify any customized build config we want to build and run our project with. 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.
#Compiling java classes with text editpr 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.
#Compiling java classes with text editpr 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.
![compiling java classes with text editpr compiling java classes with text editpr](https://1.bp.blogspot.com/-4xkWmFwGsH8/V9Mvn7-imqI/AAAAAAAAE_Q/pQNTmQJW3TcirT9vBM65D1Q0ADhJiCRDwCLcB/s1600/PluginInstallNotepad%252B%252B.png)
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. 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.