Java

Share Java code online.

Share Java classes, Spring Boot handlers, or design patterns: syntax-highlighted and instantly shareable.

textdrop.sh/xk4mR2
1@RestController2@RequestMapping("/api/users")3@RequiredArgsConstructor4public class UserController {56    private final UserService userService;78    @GetMapping("/{id}")9    public ResponseEntity<UserDto> getUser(@PathVariable Long id) {10        return userService.findById(id)11                .map(UserDto::from)12                .map(ResponseEntity::ok)13                .orElse(ResponseEntity.notFound().build());14    }1516    @PostMapping17    @ResponseStatus(HttpStatus.CREATED)18    public UserDto createUser(@Valid @RequestBody CreateUserRequest req) {19        return UserDto.from(userService.create(req));20    }21}
Every paste includes

Java syntax highlighting

Paste Java code and get a shareable link with full syntax highlighting, server-side rendered with no JavaScript overhead.

Burn after read

Deleted on first open. Can't be viewed twice.

Password protection

Add a password for end-to-end encryption with no raw key stored.

Configurable expiry

Set pastes to expire after 1 hour, 1 day, 7 days, or up to 30 days. Gone when you say so.

No account needed

No sign-up, no email, no ads. Paste and share in seconds.

How it works
Plain Text
Markdown
Code
DB_HOST=db-01.prod.internal
DB_USER=api_svc
DB_PASS=xK9$mP2!qR7nLw2
REDIS_URL=redis://:abc@cache:6379
delete after setup — expires 1hr
7 days
Share
textdrop.sh/
7 days · plain text
Use cases
  • 01Share Spring Boot controller patterns
  • 02Send design pattern implementations
  • 03Share stream API examples
  • 04Distribute service layer code for review
  • 05Send exception handling patterns
FAQ
Does textdrop.sh highlight Java annotations?+

Yes. The Java grammar highlights annotations, generics, and lambda expressions.

Can I share Kotlin alongside Java?+

Yes: textdrop.sh supports both Java and Kotlin as separate language options.

Is there a line limit?+

No line limit. Pastes up to 5 MB are supported.

Other languages
Drop your code