0

I'm having trouble trying to understand why my program will only work in VS code. When I select inside VS code to run it will populate my gui table. However if I try to run the file inside the terminal while inside the code

java DbConnection.java

This is whats inside my .vscode/settings.json

{
    "java.project.sourcePaths": ["src"],
    "java.project.outputPath": "bin",
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "/Users/mattgranado/Desktop/SQLiteJDBC/**/*.jar"
    ]
}

the error below will occur.

enter image description here

mattgcf
  • 33
  • 6
  • what do you have in `.vscode/settings.json`? I think is working on vscode because is adding your external libs on classpath. but when you run on terminal is getting only current project. you need add your external lib in your current process ( eg. adding external jars on class path , using a build tool ( maven or gradle ) to generate fatJat with all jar inside ). – Dilermando Lima Oct 07 '21 at 00:51
  • try run on terminal like this https://stackoverflow.com/a/219801/7505687 but I suggest you using a tool for manage dependencies and build like maven or gradle and have happy life :) – Dilermando Lima Oct 07 '21 at 01:03
  • .vscode/settings.json { "java.project.sourcePaths": ["src"], "java.project.outputPath": "bin", "java.project.referencedLibraries": [ "lib/**/*.jar", "/Users/mattgranado/Desktop/SQLiteJDBC/**/*.jar" ] } @DilermandoLima – mattgcf Oct 11 '21 at 01:12
  • 1
    Please refer to the link @DilermandoLima shared that compile .java file with .jar then see if the question goes away. – Molly Wang-MSFT Oct 11 '21 at 06:50

0 Answers0