Top Related Projects
The Julia Programming Language
Visual Studio Code
Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
The developer platform for on-demand cloud development environments to create software faster and more securely.
VS Code in the browser
Quick Overview
JetBrains/projector-server is an open-source project that allows running JetBrains IDEs and Swing-based apps remotely, accessed through a web browser. It enables users to work with their favorite development environments from any device with a modern web browser, providing a seamless remote development experience.
Pros
- Enables remote access to JetBrains IDEs and Swing applications
- Improves collaboration and remote work capabilities for development teams
- Reduces hardware requirements for client devices, as processing occurs on the server
- Supports various deployment options, including Docker containers
Cons
- May experience latency or performance issues depending on network conditions
- Requires server-side setup and maintenance
- Limited to JetBrains IDEs and Swing-based applications
- Potential security concerns when exposing development environments over the network
Getting Started
To get started with Projector Server, follow these steps:
- Install Docker on your system
- Pull the Projector Server Docker image:
docker pull registry.jetbrains.team/p/prj/containers/projector-idea-c
- Run the container:
docker run --rm -p 8887:8887 -it registry.jetbrains.team/p/prj/containers/projector-idea-c
- Open a web browser and navigate to
http://localhost:8887
to access the IDE
For more advanced configurations and deployment options, refer to the project's documentation on GitHub.
Competitor Comparisons
The Julia Programming Language
Pros of Julia
- High-performance scientific computing language with a focus on numerical and technical computing
- Designed for parallelism and distributed computing out of the box
- Extensive ecosystem of libraries and packages for various scientific domains
Cons of Julia
- Smaller community and ecosystem compared to more established languages
- Longer compilation times, especially for the first run of a program
- Steeper learning curve for developers coming from non-scientific programming backgrounds
Code Comparison
Julia:
function mandelbrot(c)
z = 0
for i=1:100
if abs(z) > 2
return i-1
end
z = z^2 + c
end
return 100
end
Projector-server (Java):
public class MandelbrotSet {
public static int mandelbrot(Complex c) {
Complex z = Complex.ZERO;
for (int i = 0; i < 100; i++) {
if (z.abs() > 2) return i;
z = z.multiply(z).add(c);
}
return 100;
}
}
Note: Projector-server is primarily focused on remote IDE access, while Julia is a programming language. The code comparison showcases a simple Mandelbrot set calculation in both languages to illustrate syntax differences.
Visual Studio Code
Pros of VS Code
- Larger community and ecosystem with extensive marketplace for extensions
- Built-in Git integration and terminal
- Lightweight and fast performance, even with many extensions
Cons of VS Code
- Less specialized for specific programming languages compared to JetBrains IDEs
- Requires more configuration for advanced features
- May lack some advanced refactoring tools available in JetBrains products
Code Comparison
VS Code (settings.json):
{
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"files.autoSave": "afterDelay"
}
Projector Server (projector.json):
{
"port": 8887,
"token": "your_access_token",
"org.jetbrains.projector.server.classToLaunch": "com.intellij.idea.Main"
}
While VS Code uses a settings.json file for configuration, Projector Server uses a projector.json file to set up the server. VS Code's configuration is more focused on editor settings, while Projector Server's configuration is primarily concerned with server setup and access control.
Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
Pros of Theia
- More flexible and extensible architecture, allowing for easier customization and integration with various tools and frameworks
- Supports multiple programming languages and can be used as a foundation for building diverse IDEs and tools
- Actively developed and maintained by a large open-source community, ensuring regular updates and improvements
Cons of Theia
- Steeper learning curve due to its complex architecture and extensive customization options
- May require more resources to run compared to Projector-server, especially for larger projects or extensions
Code Comparison
Theia (TypeScript):
import { injectable } from 'inversify';
import { MenuModelRegistry } from '@theia/core';
@injectable()
export class MyMenuContribution implements MenuContribution {
registerMenus(menus: MenuModelRegistry): void {
// Menu registration logic
}
}
Projector-server (Kotlin):
class ProjectorLauncher {
fun launch(args: Array<String>) {
val server = ProjectorServer()
server.start(args)
}
}
While both projects serve different purposes, this comparison highlights the key differences in their architecture and implementation. Theia offers a more flexible and extensible framework for building IDEs, while Projector-server focuses on providing remote access to JetBrains IDEs.
The developer platform for on-demand cloud development environments to create software faster and more securely.
Pros of Gitpod
- Provides a complete cloud-based development environment
- Supports a wide range of programming languages and frameworks
- Offers seamless integration with popular version control platforms
Cons of Gitpod
- May have a steeper learning curve for users new to cloud IDEs
- Requires an internet connection for full functionality
- Can be more resource-intensive for complex projects
Code Comparison
Gitpod configuration (.gitpod.yml
):
image: gitpod/workspace-full
tasks:
- init: npm install
command: npm start
Projector-server configuration (example):
fun main() {
runProjectorServer(
port = 8887,
ideDir = "/path/to/ide"
)
}
While Gitpod provides a more comprehensive cloud development environment, Projector-server focuses on remote access to JetBrains IDEs. Gitpod offers a wider range of language support and integrations, but Projector-server may be more suitable for users specifically working with JetBrains products. The code examples show the simplicity of Gitpod's configuration compared to Projector-server's more specific setup for JetBrains IDEs.
VS Code in the browser
Pros of code-server
- Broader language support, not limited to JetBrains IDEs
- More lightweight and easier to set up
- Active community and frequent updates
Cons of code-server
- Less feature-rich compared to full JetBrains IDEs
- May lack some advanced debugging and refactoring tools
- Performance can be slower for large projects
Code Comparison
projector-server:
fun main() {
runProjectorServer(
ProjectorConfig(
port = 8887,
ideType = IdeType.IDEA
)
)
}
code-server:
const server = await launch({
port: 8080,
host: '0.0.0.0',
auth: 'password'
});
Both repositories aim to provide remote development environments, but they take different approaches. projector-server focuses on delivering JetBrains IDEs over the web, while code-server offers a web-based version of Visual Studio Code. The choice between them depends on your preferred development environment and specific project requirements.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
projector-server
Server-side library for running Swing applications remotely.
The state of Projector
The development of JetBrains Projector as its own standalone product has been suspended. That said, Projector remains an important part of JetBrains Gateway, which is the primary remote development tool for JetBrains IDEs. We will focus our efforts on improving and developing Projector in this limited scenario.
Our goal is to provide a rich, full-featured remote development experience with a look and feel that is equal to or better than what you get when working with IDEs locally. The only way to get everything youâre used to having when working locally (low latency, low network traffic, user-defined and OS-specific shortcuts, themes, settings migrations, ssh-agent/port forwarding, and other things) is by installing a dedicated client-side application. The standalone version of Projector is not capable of meeting these goals.
As a result, we no longer recommend using the standalone version of JetBrains Projector or merely making tweaks to incorporate it into your existing IDE servers. We wonât provide user support or quick-fixes for issues that arise when these setups are used. If you have the option to switch from Projector to Gateway, we strongly recommend you do so.
Learn more about JetBrains Gateway
Building
The following command creates a zip file with the whole runtime classpath:
./gradlew :projector-server:distZip
You can find the file here: /<project-root>/projector-server/build/distibution/projector-server-<server-version>.zip
.
By default, a proper revision of projector-client:projector-common
at GitHub will be used as a dependency. If you want to use
local projector-client
, please specify a special local property useLocalProjectorClient=true
as a line in local.properties
file (
create this file if you don't have one). You can find an example in local.properties.example file. After
specifying this property and reloading Gradle build script, local projector-client
from ../projector-client
will be used as the
dependency.
to use the local projector-client, the folders must be located as follows:
.
âââ projector-client
âââ projector-server
How to run my application using this?
There are two ways.
Not modifying your application code
This is the recommended way. You can use it if you don't have any preference. You don't need to rebuild your app at all here.
In the projector-server
project, there is a ProjectorLauncher
main class. It sets headless stuff up itself and then calls another main class. The name of the class-to-launch is obtained from the System Properties and program arguments are passed to the main
of the class-to-launch without changing.
Extract libs
folder from projector-server-VERSION.zip
to add it to classpath later.
To launch your app, change your run script like this:
java \
-classpath YOUR_USUAL_CLASSPATH:libs/* \
-Dorg.jetbrains.projector.server.classToLaunch=YOUR_USUAL_MAIN_CLASS \
org.jetbrains.projector.server.ProjectorLauncher \
YOUR_USUAL_MAIN_ARGUMENTS
As you see, you should add the libs
folder to you classpath. Also, you should change the main class to the ProjectorLauncher
but pass your original main class as a special System Property.
We have an example in our demo app called projector-demo.
Also, we've tested this variant with IntelliJ IDEA. Just download it from the download page and only change the idea.sh
script. In the end of default script, the are lines like the following:
...
CLASS_PATH="$CLASS_PATH:$IDE_HOME/lib/jnr-posix-3.0.50.jar"
# ---------------------------------------------------------------------
# Run the IDE.
# ---------------------------------------------------------------------
IFS="$(printf '\n\t')"
# shellcheck disable=SC2086
"$JAVA_BIN" \
-classpath "$CLASS_PATH" \
${VM_OPTIONS} \
"-XX:ErrorFile=$HOME/java_error_in_idea_%p.log" \
"-XX:HeapDumpPath=$HOME/java_error_in_idea_.hprof" \
"-Djb.vmOptionsFile=${USER_VM_OPTIONS_FILE:-${VM_OPTIONS_FILE}}" \
${IDE_PROPERTIES_PROPERTY} \
-Djava.system.class.loader=com.intellij.util.lang.PathClassLoader -Didea.strict.classpath=true -Didea.vendor.name=JetBrains -Didea.paths.selector=IdeaIC2022.1 -Didea.platform.prefix=Idea -Didea.jre.check=true -Dsplash=true \
com.intellij.idea.Main \
"$@"
You should change them to:
...
CLASS_PATH="$CLASS_PATH:$IDE_HOME/lib/jnr-posix-3.0.50.jar"
CLASS_PATH="$CLASS_PATH:$IDE_HOME/projector-server-<server-version>/lib/*"
# ---------------------------------------------------------------------
# Run the IDE.
# ---------------------------------------------------------------------
IFS="$(printf '\n\t')"
# shellcheck disable=SC2086
"$JAVA_BIN" \
-classpath "$CLASS_PATH" --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.desktop/java.awt.dnd.peer=ALL-UNNAMED \
${VM_OPTIONS} \
"-XX:ErrorFile=$HOME/java_error_in_idea_%p.log" \
"-XX:HeapDumpPath=$HOME/java_error_in_idea_.hprof" \
"-Djb.vmOptionsFile=${USER_VM_OPTIONS_FILE:-${VM_OPTIONS_FILE}}" \
${IDE_PROPERTIES_PROPERTY} \
-Djava.system.class.loader=com.intellij.util.lang.PathClassLoader -Didea.strict.classpath=true -Didea.vendor.name=JetBrains -Didea.paths.selector=IntelliJIdea2022.1 -Didea.jre.check=true -Dsplash=true \
-Dorg.jetbrains.projector.server.classToLaunch=com.intellij.idea.Main org.jetbrains.projector.server.ProjectorLauncher \
"$@"
Don't forget to place JARs from projector-server
distribution to $IDE_HOME/projector-server-<server-version>/lib
.
Also, you can find this example in projector-docker where these actions are done automatically.
Modifying your application code
Using this way, you can add a custom condition to start the server.
Add a dependency to the projector-server
project to your app. In the beginning of your main
, decide if you want to run the app headlessly. If yes, invoke System.setProperty("org.jetbrains.projector.server.enable", "true")
and call the runProjectorServer
method of the ProjectorLauncher
.
When you go this way, ensure that no AWT nor Swing operations are performed before the initialization of the server. Such operations can cause some lazy operations of AWT happen and our server doesn't support that.
This way is demonstrated in projector-demo too.
Run with Gradle tasks
There are two gradle tasks for running server. They are handy when developing. To enable them, you should set some properties in local.properties
file in the project root. Use local.properties.example as a reference.
-
runServer
— launch your app with Projector Server. Required properties:projectorLauncher.targetClassPath
— classpath of your application;projectorLauncher.classToLaunch
— FQN of your application main class.
-
runIdeaServer
— launch IntelliJ IDEA with Projector Server. Required property:projectorLauncher.ideaPath
— path to IDEA's root directory.
Connection from browser
When the server is launched, you can open localhost:8887
in the browser to access the app.
Notes
Currently, projector-server
supports only Linux and JetBrains Runtime 11 and 17 as JRE.
To set the port which will be used by Projector Server for WebSocket, use the -Dorg.jetbrains.projector.server.port=<port-number>
System Property.
Contributing
License
Top Related Projects
The Julia Programming Language
Visual Studio Code
Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
The developer platform for on-demand cloud development environments to create software faster and more securely.
VS Code in the browser
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot