简体   繁体   中英

BlueJ packaged Jar isn't working

After writing a project I am trying to package it in a jar through BlueJ. It lets me do it however the jar doesn't run when I click it and when I try to run from Command prompt it says unable to access Jarfile. Normally this would probably be pretty open and shut however I want to know if the way I coded it will be a problem.

The project is a GUI application that also takes input from the console, will that input be taken from the command prompt when the jar is run? Also, my main class extends JPanel while my body class (which has most of the code as the main acts as a driver and a place to put paintComponent) extends JFrame. Will this be an issue? Will making this project a jar in eclipse make this any better?

The project is a GUI application that also takes input from the console, will that input be taken from the command prompt when the jar is run?

It will accept arguments passed when the main is called, but usually there would be no console displayed for a runnable Jar so forget 'interacting' with it.

Also, my main class extends JPanel while my body class (which has most of the code as the main acts as a driver and a place to put paintComponent ) extends JFrame .

Why extend frame? Just use an instance of one.

Will this be an issue? Will making this project a jar in eclipse make this any better?

Do you mean 'working'? No. BlueJ can make runnable Jars, figure out how to do it right using that, before using another IDE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM