Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am a student learning Java and I want to compile and run some simple Java on ST2. Also Eclipse is very slow on my laptop.

Here is my JavaC.sublime-build file so far:

{
    "cmd": ["sublimejavaexec.bat", "$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.java"
}

So far it can run code that does not require user input. However when I have something that uses the Java input scanner it either skips through or generates an error.

Can anyone suggest a solution such as a plug-in or if ST2 actually has this kind of feature on its console?

Thanks.

share|improve this question

1 Answer 1

just create a javacr bash/bat with something like

#!/bin/sh
javac $1.java
java $1

and inside your JavaC.sublime-build:

{
  "cmd":["javacr","$file_base_name"],
  "file_regex": "^(...?):([0-9]):?([0-9]*)", 
  "selector": "source.java" 
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.