I think I found a bug

Question:
I have this code on java, that works when I coonect to Elephant SQL, ( ElephantSQL will manage administrative tasks of PostgreSQL, such as installation, upgrades to latest stable version and backup handling. ElephantSQL is also integrated to several cloud application platforms )
“SELECT * FROM datos” and it works. The problem is that I copy the code and put in another project, I did all the configurations but when I write in commands shells: main Java, the console give me a “Hello” World " even though I don’t have any Hello World in my project

Hey @wowabrahan54!

Have you renamed your Main.java file?

5 Likes

No I didn’t. In both projects there is a Main.java, that have the codes

Could you please share a link to one of your Repls?

1 Like

Sure

This project work:
https://replit.com/@wowabrahan54/conexionpostgreSQLjava#Main.java
With this command in shell: java -cp “.:postgresql-42.6.0.jar” Main

This doesn’t work:
https://replit.com/@wowabrahan54/conexionpostgreSQLjava2#Main.java

That does work for me, I get this:

1 Like

yeah, itfyou run you will get errors, but to recieve the information of the table I write:
java -cp ".:postgresql-42.6.0.jar" Main
in comand shell ,and in theoric have to bring me the Information.
But that command doesn’t work in the second project.
Yeah, do “run” in both projects give errors

Like this:

From here

Did some testing, I can’t seem to get around that one error:

~/a$ java -cp “.:postgresql-42.6.0.jar” Main
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
~/a$ java -cp “.:postgresql-42.6.0.jar” Main.java
Main.java:33: error: cannot find symbol
            System.out.println(resultSet.getint("id") + ", " + resultSet.getString("nombre"));
                                        ^
  symbol:   method getint(String)
  location: variable resultSet of type ResultSet
1 error
error: compilation failed
1 Like

I don’t what to say
a4

The first command I copy from your console, the second from my documentation.
But I did compare text and tt’s the same

I see the issue actually, the quotes on one of them is Discourse’s auto-quotes.

ohh, what does mean?

smart: java -cp “.:postgresql-42.6.0.jar” Main
VS:
normal: java -cp ".:postgresql-42.6.0.jar" Main

The smart quotes break things.

I see now the difference, thankss

The second indeed works for me on your #2 repl.

That’s good, but not still for me
This is my 2 replit
a5

Yeah I can’t say why it does that.

Actually, I can, the Main.class file is just a hello world.

:dizzy_face: how?, I try to refresh for example: javac Main.java and java Main and still get the Hello world