Sublime Forum

New mem need help

#1

Hi there!

First of all, I’m very new at Sublime Text!
and i have an error while i try to compile java file.

I found a solution somewhere which basicly if i understand correctly creates a new build system so when i press ctrl + B it “compiles” the code and show it to me at the bottom.

Here is the code what I found.

{ “cmd”: [“javac”, “$file_name”,"&&",“start”,“cmd”,"/k",“java”, “$file_base_name”], “path”:“C:\Program Files\Java\jdk-11.0.2\bin”, “shell”: true }

And whenever I press ctrl+B it gives me two errors

FIrst:

error: invalid flag:Usage: javac use --help for a list of possible options[Finished in 1.0s]

and the second:

error: invalid flag:

Usage: javac
use --help for a list of possible options
[Finished in 3.2s with exit code 2]
[cmd: [‘javac’, ‘’, ‘&&’, ‘start’, ‘cmd’, ‘/k’, ‘java’, ‘’]]
[dir: C:\Program Files\Sublime Text 3]
[path: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\QuickTime\QTSystem;C:\Users\galan\AppData\Local\Microsoft\WindowsApps;]

any help?

0 Likes

#2

Maybe you did not save your file ? the filename appears blank in the command you are running :
[cmd: [‘javac’, ‘’, ‘&&’, ‘start’, ‘cmd’, ‘/k’, ‘java’, ‘’]]

0 Likes

#3

If you wish for the command to run in a shell you need to use "shell_cmd" instead of "cmd". Otherwise it will try to pass && as an argument to javac.

2 Likes