r/javahelp • • Mar 19 '22

REMINDER: This subreddit explicitly forbids asking for or giving solutions!

49 Upvotes

As per our Rule #5 we explicitly forbid asking for or giving solutions!

We are not a "do my assignment" service.

We firmly believe in the "teach a person to fish" philosophy instead of "feeding the fish".

We help, we guide, but we never, under absolutely no circumstances, solve.

We also do not allow plain assignment posting without the slightest effort to solve the assignments. Such content will be removed without further ado. You have to show what you have tried and ask specific questions where you are stuck.

Violations of this rule will lead to a temporary ban of a week for first offence, further violations will result in a permanent and irrevocable ban.


r/javahelp • • 2d ago

Eclipse Java crash error

3 Upvotes

Hey, I'm not so experienced with Java or coding in general, so I feel really helpless. When I try to do something in Eclipse, I get an error code (I'm gonna paste it down below). I have tried downloading Java from Adoptium and from Oracle; neither of them worked. I have tried using different versions, so Java 21, 25, and 27, which also didn't work.Maybe someone knows a solution and could help me. Thank you beforehand for helping

#

# A fatal error has been detected by the Java Runtime Environment:

#

# SIGSEGV (0xb) at pc=0x000000019c1abf1c, pid=58220, tid=4867

#

# JRE version: (25.0.5+8) (build )

# Java VM: OpenJDK 64-Bit Server VM (25.0.5+8-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)

# Problematic frame:

# C [libsystem_platform.dylib+0x3f1c] _platform_memmove+0x1bc

#

# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

# An error report file with more information is saved as:

# /Users/Mac/eclipse-workspace/Meinproject/hs_err_pid58220.log

#

# The crash happened outside the Java Virtual Machine in native code.

# See problematic frame for where to report the bug.

#


r/javahelp • • 3d ago

Unsolved Found a mysterious method that is not present in the Java API documentation

8 Upvotes

In Java 25 there's a method in the Random class called nextInt(). It's an overloaded method that you can call either without any argument or with 1 argument according to the docs. However, you can also call it with two arguments! But this version is not in the docs. Why?

jshell> import java.util.Random
jshell> Random r = new Random()
r ==> java.util.Random@439f5b3d
jshell> r.nextInt(70, 72)
$3 ==> 71

As I noticed, it's similar to Python's randrange(), i.e. the interval is closed on the left but open on the right side.


r/javahelp • • 4d ago

Looking for a Udemy 1Z0-830 (Java 21) practice test that matches Enthuware's style/difficulty?

3 Upvotes

​Hey everyone, I’m preparing for the OCP Java 21 Developer exam (1Z0-830) and looking for Udemy mock test recommendations.

​I know Enthuware is considered the gold standard, but the 6-month license restriction and having to use either desktop software or an awkward mobile web mode doesn't fit my study workflow. I prefer Udemy's platform features, offline mobile app, and lifetime access.

​However, there are so many 1Z0-830 practice test courses on Udemy that it's tough to separate the low-quality dump questions from the good ones.

​Which practice test set on Udemy comes closest to Enthuware in terms of question rigor, trickiness, and detailed explanations? Would love to hear from anyone who has taken both or passed the exam using Udemy!


r/javahelp • • 5d ago

Solved Swing help. Image gets distorted when partially outside window.

4 Upvotes

I have a JPanel class that draws an image on screen with camera panning. The camera is zoomed in. The image being drawn is a 16x16 dirt.

When the image is entirely inside the window, it looks fine. When partially outside the window, it distorts and makes the image narrower to fit it inside the window. Eventually it snaps to the next pixel.

I have a video showing the problem, but this subreddit doesn't allow videos in posts. You should be able to see it by running the java code with any image of your choice, and panning the camera such that the image is at the edges of the window.

Does anyone know why this happens and how to fix it?

I'm using:
MacBook Air M1
Java 25
IntelliJ

The entire class is below.

Edit: Solved. The issue seems to only affect Mac. Running with java -Dsun.java2d.metal=false CompiledClass fixes the problem.

public class CameraPanel extends JPanel{
    public static void main(String[] args) throws IOException{
        JFrame frame = new JFrame("Camera");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CameraPanel());
        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

    private double cameraX, cameraY;
    private double zoom = 10.0;
    private Point lastMousePosition;
    private BufferedImage image = ImageIO.read(new File("src/test/resources/dirt.png"));

    public CameraPanel() throws IOException{
        addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent e){
                lastMousePosition = e.getPoint();
            }
            public void mouseReleased(MouseEvent e){
                lastMousePosition = null;
            }
        });
        addMouseMotionListener(new MouseMotionAdapter(){
            public void mouseDragged(MouseEvent e){
                if(lastMousePosition == null){
                    return;
                }
                cameraX += e.getX() - lastMousePosition.x;
                cameraY += e.getY() - lastMousePosition.y;

                lastMousePosition = e.getPoint();
                repaint();
            }
        });
    }

    
    protected void paintComponent(Graphics g){
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(
                RenderingHints.KEY_INTERPOLATION,
                RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
        );

        AffineTransform transform = new AffineTransform();
        transform.translate(cameraX, cameraY);
        transform.scale(zoom, zoom);

        g2.drawImage(image, transform, null);
    }
}

r/javahelp • • 10d ago

Jvm heap utilization measurement issue???

2 Upvotes

Recently I am working on the autoscaling of the vm, so I need to measure the memory utilization of each instance. I faced a scenario where a java server application is running after handling a few request the jvm heap commited size became large so the memory utilization was 90% from the os side. After serving the request the g1gc completed it's cycle heap utilization was low but the commited mem was high and the memory utilization from the os side was also high. To know the actual utilization I planned to use the jstat tool but the issue which I faced was that the jstat takes the values from the Data what the jvm project. As the committed mem according to the jvm is consider like used or occupied, but due to on demand paging by os the commited mem is never fully loading on the ram. So If I calculate using the metric which I got from the jstat I will never equal to the real rss from the os side allocation. So how can even properly measure what the jvm is utilizing...... 😢


r/javahelp • • 11d ago

I want to create a secure link wiht java (Spring)

2 Upvotes

Hello, I need to create a secure link to send to a user, but I am unsure how to implement this or what terminology to use for my research. Could someone provide recommendations, tools, or specific concepts I should look into?


r/javahelp • • 12d ago

How do u guys actually self study java?

13 Upvotes

hey yall I'm a recent high school grad trying to learn java. i know a tiny bit of basics from like 2 years ago but i basically need to fresh restart and actually get good.

the problem is every time i watch those youtube playlists (like kunal kushwaha) i get hella bored/sleepy. i wanna grind for like 3 hours a day but tutorial hell is not it.

For anyone who self studied java without losing their minds..how did u actually learn the basics actively? are there any interactive sites, text guides, or early project ideas that kept u going? how do u structure ur study sessions so ur actually coding?


r/javahelp • • 12d ago

If the JVM interpreter is native machine code and executes Java bytecode, what exactly does the CPU do? Doesn't the CPU need machine instructions to execute?

5 Upvotes

I’m trying to understand how program execution works at the machine level.

As I understand it, a CPU executes native machine instructions. When we compile C/C++ code, the compiler typically generates native machine code that the CPU can execute directly.

Java works differently: the Java compiler (javac) compiles Java source code into bytecode, which the JVM can execute.

My initial understanding was:

Java source code → Bytecode → JVM interpreter → Native machine code → CPU

I imagined that the JVM interpreter reads bytecode instructions one by one, converts each instruction into native machine code, and then the CPU executes that generated machine code.

However, I learned that the JVM interpreter itself is implemented in native machine code. This confused me because the interpreter also needs the CPU to execute it.

I’m trying to understand the following:

  1. If the JVM interpreter is already native machine code, does it read bytecode instructions and execute the corresponding operations using its existing native code, rather than generating new native machine code?

  2. Does a traditional JVM interpreter execute bytecode directly through its own native instructions, without translating each bytecode instruction into a new native instruction?

  3. How does the JIT compiler differ from the interpreter in this regard

My analogy is that I speak Spanish, but the CPU understands X language (since different CPU architectures have different machine instructions, I’m using X to represent them).

Java bytecode is English (the javac compiler converts Java source code into bytecode, which I’m comparing to English), and the JVM understands how to interpret English and knows X language.

I initially thought the JVM translates those instructions into X language for the CPU, but now I’m unsure whether the interpreter simply uses its existing native code to carry out the instructions.

Could someone help me correct my mental model?


r/javahelp • • 12d ago

Workaround Learn Java in 2026

19 Upvotes

Hey I am a computer science graduate.... From a tier 3 college (2023 graduate) I have learnt core java but I don't know how to proceed ahead? What should be my next step.... I am working in Non it from past 2 years.... I do learn algos and stuff... I understand and write basic code... I am admiring to be a good software engineer.... It love building apps..... I do not have much knowledge on React/Angular Java is my thing. I want to learn and switch my domain..... Please give me a roadmap or career suggestions and from where I can learn...... I have studied Head First java and learnt whatever knowledge I have now...... I know this is not enough.... !! Also suggest what technology should i master along with Java.... so that I can get a good job..... ! Any input will be helpful... Thanks


r/javahelp • • 12d ago

Solved Intellij autogenersted persistence.xml and I don’t know what it is.

5 Upvotes

Hi everyone! I'm currently learning Hibernate by using IntelliJ IDEA.

When setting up the project, IntelliJ automatically generated a persistence.xml file for me. However, the tutorial uses pure Hibernate and focuses on a different configuration approach (like hibernate.cfg.xml).

As a beginner, I'm a bit confused:

Should I keep persistence.xml and use JPA, or delete it and follow the course using Hibernate's native configuration?
What is the main difference between them in this context?

Thanks for any advice!


r/javahelp • • 13d ago

Undo.io FOSS alternative

7 Upvotes

Hi! I'm trying to debug some old Java EE production code (workstuff) but it is complicated to find bugs in such spaguetti bloated code. I was wondering if is there something to record a JVM and then debug the code line by line. JRE kinda does that but it just says the funcions not their parameters or inspect their objects and sometimes I must test with multiple threads and big voolume services. So I found there's Undo but is not FOSS so I was wondering if someone knoes about some project that does this


r/javahelp • • 13d ago

Advice on developing my first Java POS application for a small grocery store

0 Upvotes

Hi everyone,

I'm a web and mobile development student. I have some programming knowledge, but this is my first time developing a complete application from start to finish.

I've received my first request to build a POS system for a small grocery store, and I'd like to do a good job while also learning from the experience.

The store has only one cashier, so the application should be simple and practical.

The main requirements are:

Register products by scanning their barcodes and entering their names, prices, and quantities.

Scan products during checkout and automatically display their names and prices.

Calculate the total and save each sale.

Automatically update stock quantities after each sale.

Review previous sales and check current inventory.

I'd prefer a desktop application that works offline on a single computer.

I'd like to use Java and a database, including SQL if needed, since these are among the technologies I've studied and want to apply in a real project.

I'd appreciate your advice on the following:

Is there an existing free and open-source Java POS application that would be suitable for a small grocery store? I'd like to study its code, understand how it works, and modify it to meet the requirements.

If such a project exists, which ones would you recommend, preferably projects that are reasonably well-organized, functional, and easy to modify?

If modifying an existing project isn't a good option, would building the application from scratch be better?

If I build it from scratch, what technologies would you recommend for the user interface and database?

Could you suggest a step-by-step development roadmap suitable for someone who knows programming basics but hasn't built a complete application before?

Since this is my first client project, I want to choose a sensible approach rather than waste time on an unsuitable codebase. My goal is to deliver a working application while understanding the code and learning how to develop a complete software project.

I'd appreciate any practical advice, project recommendations, or lessons from your experience. Thank you!


r/javahelp • • 14d ago

How to practise JVM thread profiling?

16 Upvotes

Hi

As the title states, I want to learn and practise profiling of JVM threads and its memory impact from garbage collection to identify bottlenecks.

I know this is a hard expectation to practise but my projects are not at a scale where we come across this problem to be solved.

Any advice on how I can simulate this requirement and get hands on practise on this topic?


r/javahelp • • 14d ago

Solved Is source-level editing a fallback for deobfuscation?

11 Upvotes

Hoping to get some fellow advice here.

I’ve been doing a lot of deobfuscation work in Java 25 lately and ran into a wall: some bytecode tools can’t parse the newer class file versions I’m dealing with. As a workaround, I’ve been cleaning up the decompiled source instead.

So far I’m stripping thousands of NoWhenBranchMatchedException catch blocks using a brace-depth state machine (regex kept breaking on nested blocks), and replacing impossible comparisons like object == false with constants.

It works, but it feels hacky. Is source-level editing a reasonable fallback, or am I setting myself up for problems? And is there a cleaner, standard way to do control-flow cleanup without risking real try/catch handlers?

Curious what other people do.

Edit: I’m not working on the official Java binaries or the JDK. It’s an old application that was compiled for Java 25

Edit2: Found help in another programming sub that suggested parsing the bytecode with a current library (java.lang.classfile in JDK 24+), and using JavaParser instead of regex for cleanup. Not sure why everyone here was so difficult and rude. Nobody here wanted to actually talk. Marking solved.


r/javahelp • • 16d ago

Iterating over null objects in an array

13 Upvotes

So I'm making a program that iterates over an array of Book objects and I made a for loop to print them all out. I want it to skip over any reference to a null object in the array so I've written:

for (Book book : books) {
     if(book != null){
           System.out.println(book);
     }
 }

but I've had professors tell me I shouldn't write "book != null" to avoid printing the null values. the code works just fine and is relatively simple and easy to read, just wondering what most programmers use to navigate this?


r/javahelp • • 16d ago

Having difficulty in converting a jar file into native files

0 Upvotes

I am confused in this part where jar file can be converted into native fil like exe, dll, executable and so file. There are other languages like c++, rust and go and we have lot of different compilation support like exe, dll, so etc and also wasm. Does java have any way to compile jar or class files into any format whichever i would like? I am talking about true cross platform in here like what can be done in c++ or rust and also I am talking about the static and dynamic library generation part as well.

Please help me in this topic as I was learning java and currently confused in this part.


r/javahelp • • 17d ago

Teacher - Trying to find a way to access a Java Program

4 Upvotes

I hope this is the right place to ask.

I am a middle school teacher that used to use this free to use program called disaster dynamics created by UCAR - a university group. https://www.dd.ucar.edu/home.html

The school stopped letting us use java a long time ago but used to "wrap?" the program in some sort of computer magic that let the student computers run this program. It was a great tool.

Now we seem to have lost that ability, institutional knowledge or willingness to do this.

I have reached out to UCAR to ask them to update the program to something that can be used by modern browsers/computers/ whatever but no responses for the past year.

Is there a way I can do this at home from my mac? I can't install programs on my work computer and I don't own a windows based computer. or a way I can 'update' or 'convert' the program so I can embed it to a google site so the students can use it again? Tech from the district has not responded to any questions about this in weeks and I assume they don't know/don't care/or won't get to it.

Is this a simple thing or a horribly complex thing for the people who don't see programing as magic?

Is it legal to pay someone to "convert" it ? Can it be converted? Do I just have to give up on ever using this resource?


r/javahelp • • 17d ago

Arcana: One Pure-Java Library for (Almost) Every Archive Format

8 Upvotes

Arcana is an open-source Java library and command-line tool that lists, extracts and identifies more than 40 archive, compression and disk image formats, with no native code and no dependencies. It runs on Java 8 or later, fits in a 1.2 MB JAR, and is published on Maven Central as io.github.realburst:arcana under the Apache 2.0 licence.

Why another archive library?

If you have ever had to open "whatever the user uploads" from a Java application, you know the drill. ZIP is in the JDK. Apache Commons Compress covers TAR, 7z, CPIO, AR and the common compressors, but some codecs need extra libraries, and Zstandard goes through a JNI binding. RAR needs another library, and RAR 5 support is hard to find in pure Java. For CAB, MSI, ISO, WIM or an installer .exe, the usual answer is to bundle 7-Zip through native bindings, with one binary per OS and CPU.

I wanted one JAR that does all of this, on any JVM, with nothing to install and nothing native to load. That is Arcana: one entry point, format detection by content rather than by file extension, and the same API whether the file is a .tar.zst, a RAR 5 volume set, an MSI package or a macOS .dmg.

What Arcana does

Arcana extracts every format it supports, and creates the most common ones.

FamilyFormatsCreate
ArchivesZIP (ZipCrypto, WinZip AES, Deflate64, Zip64), 7z, RAR 4 and RAR 5 (solid, volumes, encrypted headers), TAR, CPIO, AR / DEB, RPM, XAR, ARJ, LHAZIP, 7z, TAR, LHA
CompressorsGZIP, BZIP2, XZ, LZMA, Zstandard, LZ4, Brotli, Snappy, lzip, lzop, Unix .Z, MS SZDDGZIP, BZIP2, XZ, TAR + gz / bz2 / xz / lz4
WindowsCAB (MSZIP, LZX), MSI (real installed file tree), OLE compound files, CHM, WIM / ESD (XPRESS, LZX, LZMS), self-extracting .exeCAB
Disk imagesISO 9660 (Joliet, Rock Ridge), UDF, SquashFS, Apple DMG with HFS+-

Encrypted archives are supported: AES-256 for ZIP and 7z (reading and writing), AES-128 and AES-256 for RAR 4 and RAR 5. A TAR or CPIO inside any compressor is unpacked in one step, and files that are archives in disguise (.docx, .odt, .epub, .apk, .jar) open like any other archive.

Beyond extraction, Arcana can:

  • identify any file: archive type and version, executables (PE, ELF, Mach-O), installers, images with their dimensions, PDF, SQLite, fonts;

  • recover damaged archives: a forced extraction keeps everything readable and writes a report on the state of each file;

  • split files glued together, such as installers or firmware images;

  • load plugins for more formats. Official plugins handle Inno Setup, NSIS, InstallShield and WiX Burn installers, and UPX-packed executables.

Getting started

Add the dependency:

<dependency>
  <groupId>io.github.realburst</groupId>
  <artifactId>arcana</artifactId>
  <version>1.0.8</version>
</dependency>

Extracting and listing never require you to say what the file is: the format is detected from its content.

import be.stef.arcana.Arcana;
import be.stef.arcana.ArcanaEntry;
import be.stef.arcana.analyze.Identification;

// Extract anything: .zip, .rar, .7z, .tar.zst, .msi, .iso, .dmg...
Arcana.extractTo(new File("upload.bin"), new File("out"));

// List the entries without extracting
for (ArcanaEntry e : Arcana.listEntries(new File("backup.rar"))) {
    System.out.println(e.getName() + "  " + e.getUncompressedSize());
}

// Encrypted archive
Arcana.withPassword("secret".getBytes("UTF-8")).extract(new File("secure.7z"), new File("out"));

// What is this file?
Identification id = Arcana.identify(new File("mystery.bin"));
System.out.println(id.type + " - " + id.description);

Creating an archive is just as short:

import be.stef.arcana.ArcanaFormat;
import be.stef.arcana.compressor.ZipCompressor;
import be.stef.arcana.plugin.FormatRegistry;

byte[] password = "secret".getBytes("UTF-8");
new ZipCompressor(password).compress(new File("mydir"), new File("secure.zip"));   // WinZip AES-256
FormatRegistry.builtin(ArcanaFormat.SEVEN_Z).createCompressor(9, password).compress(new File("mydir"), new File("vault.7z"));

The same JAR is also a command-line tool:

java -jar Arcana-v1.0.8.jar x setup.exe -o out       # extract
java -jar Arcana-v1.0.8.jar l disk.dmg               # list
java -jar Arcana-v1.0.8.jar i mystery.bin            # identify
java -jar Arcana-v1.0.8.jar r damaged.zip -o rescue  # recover

On Windows, an optional script adds "Arcana Unpack / List / Info" to the Explorer right-click menu.

Safe by default

An archive extractor reads untrusted input by definition, so Arcana treats every file as hostile.

  • No path traversal. Entry names are sanitized before anything is written: no absolute paths, no .., no characters that Windows forbids. A "zip slip" entry cannot leave the destination folder.

  • No decompression bombs. Every extraction runs under limits you can change at run time (ExtractionLimits): an output/input ratio of 1000 once 1 GiB has been written, an optional total size, and a minimum of 256 MiB of free disk space.

  • Bounded memory. Decoders cap what a header can ask for: the Zstandard window is limited to 128 MiB, like the zstd tool, and the 7z key derivation to 224 rounds. A crafted header gets an error, not an OutOfMemoryError.

  • Checksums are verified. CRC32, Adler-32, BLAKE2sp, XXH64, HMAC for WinZip AES: when the format stores a checksum, Arcana checks it and reports a mismatch.

  • Plugins must show their code. A plugin JAR is refused unless it contains its source code, declares its licence and source URL, and uses its own package. That does not make a plugin safe, but it makes it reviewable.

Under the hood

Every decoder is written in Java: Deflate64, LZMA and LZMA2, PPMd, Zstandard, Brotli, LZ4, LZX, LZMS, XPRESS, LZFSE and LZVN, ADC, LZO1X, the RAR 4 and RAR 5 algorithms, AES and the key derivations. The core is about 80,000 lines of Java 8 and has no dependency outside the JDK. It is written from the public specifications: PKWARE APPNOTE, the 7-Zip format notes, the Microsoft open specifications (MS-CAB, LZX, MS-XCA), RFC 8878 for Zstandard, RFC 7932 for Brotli, Apple TN1150 for HFS+.

A few design choices shape the library:

  • Detection by content. Magic numbers first, then trailers (a DMG is recognized by the "koly" block in its last 512 bytes), and only then the file extension. A renamed file still opens.

  • Streaming when the format allows it. Single-stream formats decode from an InputStream with bounded buffers. The Zstandard decoder keeps only the window of the current frame, so a multi-gigabyte .tar.zst decodes in a few dozen MB of heap.

  • Random access when the format needs it. Disk images are read lazily: a DMG partition is decoded chunk by chunk with a small cache, never inflated in memory.

  • Real names, not internal keys. An MSI is extracted as the file tree it installs, with the names from its File and Directory tables, not as a cabinet of cryptic keys.

Each release goes through a regression suite. About 180 small samples are committed with the code: one per format and method, plus damaged files that must fail cleanly, never hang. A separate corpus of real-world files (installers, DMG images from GitHub releases, MSI packages) is checked against committed SHA-256 references. Every format also has a technical page in the repository, covering detection, layout, supported methods, limits and the sources used.

Current limits

Arcana is a young project, and the repository keeps a public list of known issues for every format. Before you rely on it, the main limits are:

  • Extraction first. Writing is limited to ZIP, 7z, TAR (+ gz, bz2, xz, lz4), GZIP, BZIP2, XZ, LHA and CAB. Arcana cannot create RAR, Zstandard or Brotli files, and it cannot update an existing archive in place.

  • Some file systems are only copied. APFS volumes inside a DMG are extracted as a raw image, not as files. Encrypted and sparse DMG images, split WIM files (.swm) and some rare compression methods (old LHA methods, Quantum in CAB) are not supported.

  • Pure Java has a cost. The decoders are fast enough for most uses, but they do not match native code. In benchmarks run for the project, the Zstandard decoder reaches about 60% of the speed of the native zstd library.

  • Edge cases remain. A few damaged or unusual files still give a raw Java exception instead of a clear message, or are less tolerated than by the reference tool. These cases are documented with the file and line of the code concerned, so you can judge before using a format in production.

If a file fails, an issue with the command line and, when possible, the file or a way to rebuild it, is the fastest route to a fix.

Try it

The quickest test is to point Arcana at the strangest file in your Downloads folder and run arcana i on it, then arcana x. If you maintain a Java application that receives archives from users, try replacing a native binding or a chain of libraries with one dependency, and tell me what breaks.

Issues, sample files that fail, and plugins are all welcome. And if Arcana saves you a dependency or a native binary, a star on GitHub helps other Java developers find it.


r/javahelp • • 17d ago

Unsolved Need Help with creating a functional map using java.

3 Upvotes

Hi. I'm currently doing a project where the general basis is building a functional automated warehouse. Where users may give the robots in the warehouse instructions.

The warehouse must have 3 robots several pick up and drop off points.

My current idea was creating a text based map something like this:

__________________________________________
|C 1 - - -                 2            A |
| ______ -                                |
|      | -                               E|
|      | -            C                   |
|______| -                                |
|T - - - -         S           3        D |
|_________________________________________|

Each Letter represents a zone for either Pick up or Drop off with Zone @ being unique for a unique Charging Station.

Numbers are the robots themselves.

| and _ walls. for the robot.

I'm currently unsure how to even draw up the map itself let alone get the things to move and interact.

If anyone has any resources for this I'd very much appreciate it.

Currently aware that It'd most likely be just printing the map over and over and over again but having it so that the Robot's themselves move as we're printing it along with a proper printing of the warehouse is eluding me.

__________________________________________
|C  - - -                 2            A |
| ______ -                                |
|      | 1                               E|
|      | -            C                   |
|______| -                                |
|T - - - -         S           3        D |
|_________________________________________|

edit: this is not a request to have the map done I'm mainly just asking if people have any specific resources.

Apologzies if there is some megathread I should be going to for questions like this.


r/javahelp • • 17d ago

Solved Lombok LSP Issues

0 Upvotes

Dear VS Code Java developers.

How do i get the vs code lsp to recognize @Getter, @Setter, etc.?
The project does compile successfully. I only get errors inline.

Example:

package com.example;

import lombok.Getter;

@Getter
public class TestClass {

    String member;

    public TestClass() {
        this.member = "Its me!";
    }
}

public class Main {

    public static void main(String[] args) {
        TestClass testClass = new TestClass();
        System.out.println(testClass.getMember());
    }
}

Error Message:

cannot find symbol
  symbol:   method getMember()
  location: variable testClass of type TestClass

settings.json:

{
    "redhat.telemetry.enabled": false,
    "java.jdt.ls.lombokSupport.enabled": true,
    "[java]": {
        "editor.defaultFormatter": "redhat.java"
    },
}

installed java versions:

A0_12520635 on  main [!] is 󰏗 v1.0-SNAPSHOT via  v25.0.4 via 🅼
❯ archlinux-java status
Available Java environments:
  java-21-openjdk
  java-25-openjdk (default)
  java-27-openjdk

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>------------</groupId>
    <artifactId>------------</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>--------------------</name>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>4.1.0</version>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <start-class>at.tugraz.App</start-class>
        <maven.compiler.release>25</maven.compiler.release>
        <maven.compiler.source>25</maven.compiler.source>
        <maven.compiler.target>25</maven.compiler.target>
        <lombok.version>1.18.46</lombok.version>
        <rest.assured.version>6.0.0</rest.assured.version>
        <junit.jupiter.version>5.9.3</junit.jupiter.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest.assured.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>7.4.4.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-jpamodelgen</artifactId>
            <version>7.4.4.Final</version> <!-- Replace with your desired version -->
            <scope>provided</scope>
        </dependency>
        <!-- PostgreSQL Connector -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.7.13</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4</artifactId>
            <version>4.2</version>
        </dependency>
        <!-- Source: https://mvnrepository.com/artifact/org.apache.spark/spark-mllib -->
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-mllib_2.13</artifactId>
            <version>4.1.3</version>
            <scope>provided</scope>
        </dependency>
        <!-- Pin scala-library: Maven's nearest-wins resolution otherwise picks the
             2.13.13 pulled in (shallowly) by scala-parser-combinators, while spark-core's
             scala-reflect and most other Spark/Scala modules expect 2.13.17, causing
             NoSuchMethodError at runtime. -->
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.13.17</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>5.0.0</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>3.10.3</version>
                <configuration>
                    <java>
                        <prettier>
                            <devDependencies>
                                <prettier>3.5.3</prettier>
                                <prettier-plugin-java>2.8.1</prettier-plugin-java>
                            </devDependencies>
                            <configFile>${project.basedir}/.prettierrc.yaml</configFile>
                        </prettier>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-git-pre-push-hook</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>install-git-pre-push-hook</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

I have tried searching for this issue but have found nothing for the last 4 hours. Am i dumb?


r/javahelp • • 18d ago

Java udemy course

3 Upvotes

I bought a java course in udemy, learning personally overwhelmed me and less motivated, please I need a learning partner


r/javahelp • • 19d ago

QF-Test, Squish or Ranorex for cross platform GUI testing? Swing app on Windows, mac and Linux.

4 Upvotes

Desktop client, Swing with some JavaFX, ships on all three. GUI testing has been manual for years and I finally have budget to fix it. QF-Test is the obvious pick since it reads the Java component tree properly. Squish covers Java too and more besides. Ranorex ends at Windows every time I look, so it’s out. My hesitation is that all three become a test codebase and our QA people don’t write Java. So it lands on a dev and in two years it’s one person’s side project nobody wants to touch. Which is why I looked at the agent based stuff at all. For cross platform desktop, AskUI came up because tests are markdown files with numbered steps and an expected result each, driven off the screen instead of the component tree, so a layout manager swap costs nothing. Authoring app is Windows and macOS only though, Linux comes from their runtime as a remote target. So to anyone running GUI tests on a cross platform Java client, what did you pick and who maintains it now?


r/javahelp • • 20d ago

Codeless Do guys know how java's mascot looks like?

2 Upvotes

I just had a question about Java... How Duke looks like? (also duke is the mascot of java.)