Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

jar does not open java swing form

RosyCrossJul 9 2018 — edited Sep 14 2018

Hi,

I am a learner.

I am using Java 8.

I have been working through some tutorials and have successfully built a number of moderately complex projects.

The tutorial I followed for the jar was this

https://www.javatpoint.com/how-to-make-an-executable-jar-file-in-java

I have followed it precisely and double checked every element.

My question is this, I am generating a .jar by creating a .MF file which identifies the main class and find that in some cases it works, calling the main works in the same way as running manually from command line, but in other cases it doesn't - I just get a brief progress on the cursor and then nothing happens.

MF FIle Content

-----------------------

Main-Class: PBCSControl

Some of the 'does not work' is java swing forms, but some of the swing forms do.

All of the swing forms work okay when manually run from command line.

I do not see any error, log file etc either when creating the jar or when running the jar.

Is there anything I can do to diagnose why it is not working for me, or anything special that I need to do to generate the jar file for a swing project?

edit: I found this by manually invoking the jar from command line instead of double clicking the file; -

c:\Java\BusinessContinuity>java -jar PBCSControl.jar

Exception in thread "main" java.lang.NoClassDefFoundError: PBCSControl$1

        at PBCSControl.main(PBCSControl.java:204)

Caused by: java.lang.ClassNotFoundException: PBCSControl$1

        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

        ... 1 more

I don't understand why it is not class defined error, when I can run the .java file manually?

This post has been answered by Teresa Modesta on Sep 7 2018
Jump to Answer

Comments

thatJeffSmith-Oracle

I can reproduce your error on your script on the start up time of your database, thanks for the example.

No, we have not supported every SET command. You can run 'HELP SET' to see which ones we are support, and also which ones we've added.

Gunther Pippèrr

Hello Jeff,

do you plan to implement  all the other set operators and formatting possibilities?

The problem is, that in older scripts or in script that should be used in SQLcl AND SQL*Plus , no errors should occur.

If the set operator has no effect, may be nobody need any more to define stuff like the record separator "recsep" , but the script should work.


May be a “ show deprecated Message” setting/switch will be helpful.

If true a message show with part of the script will be ignored, if false nothing will be written to the console.

For example if you use “set” to set a options and one option is not implemented , you get an error that the first option is not correct:


SQL> set linesize 130 pagesize 300 recsep off
SP2-0158: unknown SET option "linesize"


But only the “recsep off” Part is invalid.


For my opinion it is very important for  the acceptance in the DBA community to have a real 100% SQL*Plus feeling + the new cool features that will help us a lot in the daily work.


I like the concept of the tool, real scripting and SQL*Plus together will help a lot with deployment scripts.


Thanks


Best Regards
Gunther

ALL of them, no. Most of what you see in the tool now is what we plan on shipping with.

That might mean some of your SQL*Plus scripts would need to be re-written if you wanted to use SQLcl. But, you might want to re-write them ANYWAY to take advantage of things like /*csv*/ or newer commands like DDL/CTAS.

We've gone over ALL of the SQL*Plus SET items and have decided which ones make sense to carry over or not. That doesn't mean we can't re-evaluate any of those.

What formatting possibilities are you looking for?

Gunther Pippèrr

Hello Jeff,

I check all my scripts and I grep out all set statements I use and I only missing  relay underline and markup.

Result of my checks over my settings in SQL*Plus scripts:

-------------------------------

-- working .-)

set verify on

set verify off

set trimspool on

set trimspool off

set trimout on

set trim on

set timing on

set timing off

set time on

set time off

set termout on

set termout off

set serveroutput on size 1000000

set serveroutput on

set serveroutput off

set pagesize 1000

set pages 100

set pages 0

set numwidth  14

set numwidth  12

set longchunksize 1000000

set long 650000

set long 64000;

set linesize 300

set lines 1000

set heading on

set heading off

set head on

set feedback on

set feedback off

set echo on

set echo off

set concat off

set verify on

set verify off

---------

ttitle left  "char set of the database" skip 2

ttitle off

-----------------------------

Not Working

-------------------------------

-- not working but for my opinion still useful

-- but may be a better solution with new SQLcl possible??

-- I create html reports with this feature to send to customer

set markup html on spool on preformat off entmap on -

set markup html on

set markup html off

-------------------------------

-- Will be nice to have this

set underline '='

set underline '-'

-------------------------------

-- not working but obsolete

--

set recsep off

set recsep wrap

set linesize 500 pagesize 9000 recsep off

But it will be better to ignore this settings like the trim as throwing an error

SQL> set trim on  line 1: "set trim on" is Obsolete.

-------------------------------

Is there a replacement for the  "set markup html" ?


Do you see a chance to get "set underline" implemented?


Thanks

Gunther

Gunther Pippèrr

Hello Jeff,

I also test all my different column format definitions and I miss the G in the number formatting of a column for the NLS_LANG depended thousand separators and the like format shortcut.

I test a lot of combination, most are working, but this is the outcome of the test:

--- Working

column col format 9999999

column col format 9999999D99

-- Not working

SQL>  column col format 9G999G999D99

SP2-0246: Illegal FORMAT string "9G999G999D99"

-- Missing

SQL>column col2 like col

--- not so important

SQL> column  access_parameters format a80  heading "access|parameter" fold_before word_wrapped

Column commands FOLD_BEFORE and FOLD_AFTER are not supported.


I think the G is important to have a language depended separator , the like will be helpful but more a nice to have.

What do you think?

Thanks


Best Regards

Gunther

Not really a replacement for SET MARKUP html, but there's

select /*html*/ * from table...the output comes back formatted as HTML code.

I'll see what's up with the UNDERLINE support.

-- Not working

SQL>  column col format 9G999G999D99

SP2-0246: Illegal FORMAT string "9G999G999D99"

I'll investigate this as well, could be a bug.

thatJeffSmith-Oracle

yeah the column format issue is a bug

Gunther Pippèrr

Hello,

I test the version 4.2.0.16.131.1023  from May 13, 2016 and  column formatting with the G like  “col format 9G999G999D99” is now working!

Very nice, -) I like it!

Best Regards

Gunther

Gunther Pippèrr

Hello Jeff,

do you see the possibility to map the old set markup command from sql*plus 1 to 1 to the new set set sqlformat as new feature?

SQL*Plus             SQLcl

---------------      --------------------------            

set markup html on   => set sqlformat html

set markup html off  => set sqlformat default

Only as synonym, alle internal features are from the new feature, all other settings set markup features will be ignored.

At the end it is mostly the same.


"set sqlformat html" is realy a cool feature for add hoc reporting, I like it!


Much better then set markup!


I have the problem that I have to work a lot in hosted environments, and a new java version is there not easy to get,

Most of the scripts should still work in both environments.


Best Regards

  Gunther

1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 12 2018
Added on Jul 9 2018
2 comments
1,007 views