How to setup Java in Sublime Text 3 – (OS – Windows)

Java

Video is ready, Click Here to View ×


This presentation will show you “How to setup Java in sublime Text 3”.

45 thoughts on “How to setup Java in Sublime Text 3 – (OS – Windows)

  1. For me it only works for simple programs, but it does not handle imports like e.g., Scanner. When I am prompted to enter values it just like ignores it. Could you please give a larger example? Thanks in advance.

  2. quick guide
    1. go to tools >> build system >> new build system
    2. paste the code
    {
    "cmd": ["javac", "$file_name","&&","java", "$file_base_name"],
    "file_regex": "^[ ]*File "(…*?)",line([0-9]*)",
    "path": "paste_your_path_here",
    "selector": "source.java",
    "shell": true
    }
    3.save it (any name you want)

    (edited)
    Additional Notes: to check the path of your jdk
    open cmd
    type this code: where java
    copy the path and add ""
    like this C:\Program Files\Java\jdk-9.0.1\bin

    enjoy coding 🙂

  3. Try this, just be sure that you have the same JDK version:

    {
    "cmd": ["javac", "$file_name","&&","java", "$file_base_name"],
    "file_regex": "^[ ]File "(…?)",line([0-9]*)",
    "path": "C:\Program Files\Java\jdk1.8.0_101\bin\",
    "selector": "source.java",
    "shell": true
    }

  4. It is showing that there is no build system.

    This is what I have:

    {
    "cmd":["javac","$file_name","&&","java","$file_base_name"],
    "file_regex": "^[ ]File "(…?)", line ([0-9]*)",
    "path":"C:\ProgramDataOracleJavajavapathjava.exe",
    "selector": "source.java",
    "shell":true

  5. {
    "cmd": ["javac", "$file_name","&&","java", "$file_base_name"],
    "file_regex": "^[ ]File "(…?)",line([0-9]*)",
    "path": "C:\Program Files\Java\jdk1.8.1_67\bin\",
    "selector": "source.java",
    "shell": true
    }

  6. {
    "cmd":["javac","$file_name","&&","java","$file_base_name"],
    "file_regex": "^[ ]file "(…?)", line ([0-9]*)",
    "path":"C:\Program Files\Java\jdk1.8.0_77\bin\",
    "selector": "source.java",
    "shell":true
    }

  7. I did exactly what you did but when i compile and run it it shows" Error: Could not find or load main class HelloWorld
    [Finished in 1.4s with exit code 1]" in the console..I do have the class file and java file it works in Scite. Can anyone help me with this?

Leave a Reply

Your email address will not be published. Required fields are marked *