I have a medium sized java project, its a system for registration of users of a fictitious company, its connected to a SQL data base, I use 2 libraries (SQL and PDF writer), each class its a different UI.
Before I used Visual Studio Code, and now I want use Sublime, this is my project structure:
MyProject
βββ .vscode
β βββ settings.json
β βββ launch.json
β βββ tasks.json
βββ src
β βββ images (images)
β β βββ logo.png
β β βββ background.jpg
β β βββ etc.png
β
β ββ All_Classes.java
β β
β β
β β
βββ bin (Archivos compilados .class)
β |
β β All.class
β β
β β
β β
βββ lib
β βββ library1.jar
β βββ library2.jar
βββ .gitignore
βββ README.md
βββ
So I tried to configure sublime for java, I watched videos in YT, but I canβt compile any class
I use Sublime portable edition 4.1.9
Can Someone help me with this problem?
I want to use Sublime as Java compiler for a project with many classes, without dying in the attempt Lol
As Sublime Text is not a compiler you wonβt have much luck using it to compile your Java code .
Jokes aside, ST provides simple build configurations for most languages. They donβt however include support for all sorts of build tools (Make, CMake, Maven, β¦) out of the box as there are too many.
If thereβs no package which already provides more sophisticated build tools, the way to go is to write build scripts (Makefile or maven specific stuff) for instance and create a build configuration to start them via ctrl+b
.
see: https://www.sublimetext.com/docs/build_systems.html
A build configuration is just a sort of script runner with build output panel.
It runs whatever runs in terminal.
The following βLemMinX.sublime-projectβ file is what I use to compile LemMinX using maven.
{
"folders": [
{
"path": "."
}
],
"build_systems": [
{
"name": "Build with Maven",
"shell_cmd": "mvnw.cmd verify -B -Pci,generate-p2 -DskipTests -Dcbi.jarsigner.skip=true -up -U"
}
],
"settings": {},
}
This is my setting.json that I had in VSCode with this project:
{
** βjava.project.sourcePathsβ: [**
** βsrcβ**
** ],**
** βjava.project.outputPathβ: βbinβ,**
** βjava.project.referencedLibrariesβ: [**
** "lib//*.jar",
** βlib/mysql-connector-java-5.1.46.jarβ,**
** βlib/itext5-itextpdf-5.5.12.jarβ**
** ],**
** βjava.debug.settings.onBuildFailureProceedβ: true**
** }**
So I should convert this .json to .sublime-project file?
Those settings look like from a dedicated dedicated build plugin, acting as frontend for a compiler or build runner like maven. I am not aware of a ST package doing so. Hence any direct conversion is not possible.
You need to design and manage your build process via shell scripts and commonly used build sytesms. Once those are set-up and working, you can call them using a *.sublime-build
configuration file.