error: cannot read: irc\gui\sbox\*.java

Questions about Thema's mods, & plugins will be answered here

Moderator: Thema

error: cannot read: irc\gui\sbox\*.java

Postby rvan1 » Sun Dec 24, 2006 6:59 am

I'm a noob trying to get up to speed on how to compile a GUI for PJIRC, by just re-compiling sbox.

I setup my (Windoz) directories like this:

c:\websites\irc\pjirc221\(binaries for 2.2.1 implementation)
..................................\img (2.2.1 images)
..................................\snd (2.2.1 sounds)
..................................\src (empty folder)
..................................\irc\gui\sbox\ (sbox .java source files)
..................................\irc\tree (empty folder)

My modified sboxcompile.bat file looks like this:

set pathsave=%classpath%
set path=%path%;C:\jdk1.5.0_04\bin
cd C:\websites\irc\pjirc221/src
set classpath=%classpath%;C:\jdk1.5.0_04;C:\websites\irc\pjirc221/src
javac -g:none -O -target 1.5 -sourcepath C:\websites\irc\pjirc221/src irc\gui\sbox\*.java
jar cfm sbox.jar META-INF/MANIFEST.MF irc\gui\sbox\*.class irc\tree\*.class
cabarc -p -r N sbox.cab irc\gui\sbox\*.class irc\tree\*.class
set classpath=%pathsave%
set pathsave=
pause


Why do you use a forward slash for the '/src' directory?
Am I supposed to have class files, or are those populated by the compile process?

I had an error that 'target release 1.1 conflicts with default source release 1.5' so changed it to 1.5 (thinking it might have to do with the jdk version).



My console winds up with a few errors:

-----------------------------------------------------------------
C:\websites\irc\pjirc221>set pathsave=C:\tomcat\common\lib;C:\jdk1.5.0_04\lib;C:
\irc

C:\websites\irc\pjirc221>set path=C:\oraclexe\app\oracle\product\10.2.0\server\b
in;c:\tomcat\bin;C:\jdk1.5.0_04\bin;c:\ant\bin;C:\PROGRA~1\nusphere\cvs;C:\PROGR
A~1\nusphere\perl\bin;C:\PROGRA~1\nusphere\apache\php;C:\PROGRA~1\nusphere\mysql
\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\AT
I Technologies\ATI Control Panel;C:\Sun\AppServer\bin;C:\jdk1.5.0_04\bin

C:\websites\irc\pjirc221>cd C:\websites\irc\pjirc221/src

C:\websites\irc\pjirc221\src>set classpath=C:\tomcat\common\lib;C:\jdk1.5.0_04\l
ib;C:\irc;C:\jdk1.5.0_04;C:\websites\irc\pjirc221/src

C:\websites\irc\pjirc221\src>javac -g:none -O -target 1.5 -sourcepath C:\website
s\irc\pjirc221/src irc\gui\sbox\*.java
error: cannot read: irc\gui\sbox\*.java
1 error

C:\websites\irc\pjirc221\src>jar cfm sbox.jar META-INF/MANIFEST.MF irc\gui\sbo
x\*.class irc\tree\*.class
java.io.FileNotFoundException: META-INF\MANIFEST.MF (The system cannot find the
path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.tools.jar.Main.run(Main.java:122)
at sun.tools.jar.Main.main(Main.java:903)

C:\websites\irc\pjirc221\src>cabarc -p -r N sbox.cab irc\gui\sbox\*.class irc\tr
ee\*.class
'cabarc' is not recognized as an internal or external command,
operable program or batch file.

C:\websites\irc\pjirc221\src>set classpath=C:\tomcat\common\lib;C:\jdk1.5.0_04\l
ib;C:\irc

C:\websites\irc\pjirc221\src>set pathsave=

C:\websites\irc\pjirc221\src>pause
Press any key to continue . . .
---------------------------------------------------------------

I'm sure I have several things wrong, but not sure where to start :(

Please give me some pointers on this :)
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Postby Thema » Sun Dec 24, 2006 8:01 am

Please would you make better use of the code & quote blocks so that I can find it easier to read your posts.
The / is a typo. I switch between Linux and Windows a lot and that kind of thing often creeps in.

My file paths are:
Code: Select all
C:\Websites\irc\pjirc2.2.1\src-|-buttons...|-dcc------|-prv..|-common
...............................|-img.......|-gui-------------|-pixx
...............................|-irc-------|-ident----|-prv..|-sbox
...............................|-META-INF..|-plugin
...............................|-smileys...|-security-|-prv
...........................................|-style
...........................................|-tree
If that lot looks rubbish then cut it and paste it into notepad. I had to use dots instead of spaces because browsers don't like spaces.

In the META-INF folder is the following file:
MANIFEST.MF
Code: Select all
Manifest-Version: 1.0
Created-By: 1.2.2 (Sun Microsystems Inc.)
All my batch files and test files are in C:\Websites\irc\pjirc2.2.1\src where the binaries are compiled to.

Bear in mind that I'm no expert and most of this I accomplished via trial & error.

8)
Go on.
Tell me I'm not nice again.
See what it gets you!
*******************************
Lost or confused?
Read the announcement topic in the
Technical Support forum for help tips.
*******************************
Thema
 
Posts: 2881
Joined: Sat Oct 18, 2003 5:34 pm

Postby Thema » Sun Dec 24, 2006 8:12 am

rvan1 wrote:Am I supposed to have class files, or are those populated by the compile process?
I always delete class files between compiles, but I don't think it matters. And yes the class files are populated by the compile process. They are the binaries that end up in the jars.
rvan1 wrote:I had an error that 'target release 1.1 conflicts with default source release 1.5' so changed it to 1.5 (thinking it might have to do with the jdk version).
The target merely tells javac to make the source compatible with the 1.1 JVM. Not sure, but I think you can ignore that message.

rvan1 wrote:My console winds up with a few errors:
I only saw the one, but it's a biggie. The compiler couldn't find the path to the java sources.

8)
Go on.
Tell me I'm not nice again.
See what it gets you!
*******************************
Lost or confused?
Read the announcement topic in the
Technical Support forum for help tips.
*******************************
Thema
 
Posts: 2881
Joined: Sat Oct 18, 2003 5:34 pm

Postby rvan1 » Mon Dec 25, 2006 8:44 am

I'm trying to undertand your directory setup. I was trying to summarize them, and I think you are too, but that approach is just leading to more questions.

Are yours actually like this:
Code: Select all
C:\Websites\irc\pjirc2.2.1\src\buttons\dcc\prv\common
C:\Websites\irc\pjirc2.2.1\src\img\gui\pixx
C:\Websites\irc\pjirc2.2.1\src\irc\ident\prv\sbox
C:\Websites\irc\pjirc2.2.1\src\META-INF\plugin
C:\Websites\irc\pjirc2.2.1\src\smileys\security\prv
C:\Websites\irc\pjirc2.2.1\src\smileys\style
C:\Websites\irc\pjirc2.2.1\src\smileys\tree


It appears that all directories & files need to go in '../src/', but they don't seem to match the paths in the example bat file. Should they actually be like this?
Code: Select all
C:\Websites\irc\pjirc2.2.1\src\ (sboxcompile.bat file)
C:\Websites\irc\pjirc2.2.1\src\META-INF\MANIFEST.MF
C:\Websites\irc\pjirc2.2.1\src\irc\tree\ (??)
C:\Websites\irc\pjirc2.2.1\src\irc\gui\sbox\ (sbox .java sources)


browsers don't like spaces.

Please don't tell me your directory names contain spaces (ie: ..\src irc\tree\) :)


The target merely tells javac to make the source compatible with the 1.1 JVM. Not sure, but I think you can ignore.


Yes, my understanding of this is it makes the code co
mpatible with older JVM's, but that this no longer works with jdk 1.5, and can't be ignored since it causes the compiler to abort. I'm not sure yet what syntax to use with jdk 1.5, but don't want to revert to a 1.4.1 compiler for this.

I only saw the one (error), but it's a biggie. The compiler couldn't find the path to the java sources.


There were a few, but generally related to the incorrect compile paths:
Code: Select all
error: cannot read: irc\gui\sbox\*.java

java.io.FileNotFoundException: META-INF\MANIFEST.MF (The system cannot find the path specified)

'cabarc' is not recognized as an internal or external command,
operable program or batch file.


The last one is about the CABs. Maybe my system doesn't have the tools or compiler for building CAB files, or they're not on the path or classpath so the process can find them?
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Postby Thema » Mon Dec 25, 2006 1:22 pm

rvan1 wrote:I'm trying to undertand your directory setup. I was trying to summarize them, and I think you are too, but that approach is just leading to more questions.

Are yours actually like this:
Code: Select all
C:\Websites\irc\pjirc2.2.1\src\buttons\dcc\prv\common
C:\Websites\irc\pjirc2.2.1\src\img\gui\pixx
C:\Websites\irc\pjirc2.2.1\src\irc\ident\prv\sbox
C:\Websites\irc\pjirc2.2.1\src\META-INF\plugin
C:\Websites\irc\pjirc2.2.1\src\smileys\security\prv
C:\Websites\irc\pjirc2.2.1\src\smileys\style
C:\Websites\irc\pjirc2.2.1\src\smileys\tree

Nope!
Replace the dots with spaces and it should become clear.
The folders you list are like this:
Code: Select all
C:\Websites\irc\pjirc2.2.1\src\irc\gui\common
C:\Websites\irc\pjirc2.2.1\src\irc\gui\pixx
C:\Websites\irc\pjirc2.2.1\src\irc\ident
C:\Websites\irc\pjirc2.2.1\src\META-INF
C:\Websites\irc\pjirc2.2.1\src\irc\security\prv
C:\Websites\irc\pjirc2.2.1\src\irc\style
C:\Websites\irc\pjirc2.2.1\src\irc\tree
Which is the way they are when unpacked from the download.

rvan1 wrote:It appears that all directories & files need to go in '../src/', but they don't seem to match the paths in the example bat file. Should they actually be like this?
Code: Select all
C:\Websites\irc\pjirc2.2.1\src\ (sboxcompile.bat file)
C:\Websites\irc\pjirc2.2.1\src\META-INF\MANIFEST.MF
C:\Websites\irc\pjirc2.2.1\src\irc\tree\ (??)
C:\Websites\irc\pjirc2.2.1\src\irc\gui\sbox\ (sbox .java sources)

Yep!

rvan1 wrote:
browsers don't like spaces.

Please don't tell me your directory names contain spaces (ie: ..\src irc\tree\) :)
No I was referring to using dots in the little ascii piture I was trying to draw of my folder layout.

rvan1 wrote:
The target merely tells javac to make the source compatible with the 1.1 JVM. Not sure, but I think you can ignore.


Yes, my understanding of this is it makes the code co
mpatible with older JVM's, but that this no longer works with jdk 1.5, and can't be ignored since it causes the compiler to abort. I'm not sure yet what syntax to use with jdk 1.5, but don't want to revert to a 1.4.1 compiler for this.
Well there's where it all falls down I guess. I still use the 1.4 JDK, and will probably continue to do so for a while yet.
Maybe next year I'll move to an IDE and ANT or something.

rvan1 wrote:
I only saw the one (error), but it's a biggie. The compiler couldn't find the path to the java sources.


There were a few, but generally related to the incorrect compile paths:
Code: Select all
error: cannot read: irc\gui\sbox\*.java

java.io.FileNotFoundException: META-INF\MANIFEST.MF (The system cannot find the path specified)

'cabarc' is not recognized as an internal or external command,
operable program or batch file.


The last one is about the CABs. Maybe my system doesn't have the tools or compiler for building CAB files, or they're not on the path or classpath so the process can find them?

The cab stuff is still available for download on MS' site I think. Otherwise you'll have to find someone that has them if you want to maintain MS compatibility. The file you want is cabsdk.exe. You will also need some MS java files, which are harder to find. Mine came with visual studio.

To be realistic, it's becoming too difficult to continue to worry about keeping backwards compatibility, and I personally feel that Plouf should let go of that requirement now and move on to a more 3D graphical gui style.

8)
Go on.
Tell me I'm not nice again.
See what it gets you!
*******************************
Lost or confused?
Read the announcement topic in the
Technical Support forum for help tips.
*******************************
Thema
 
Posts: 2881
Joined: Sat Oct 18, 2003 5:34 pm

Postby rvan1 » Tue Dec 26, 2006 1:18 am

OK, thx, I'm compiling now, understand how to set things up, and what the compile bat file is doing.

I was supposed to be using the 'src' files from the full release, not the 'bin' or 'pdk' files. The sbox files go in '/src/', while the '/sbox/' java source directory goes in '/irc/gui/'. The manifest doesn't do much, but needs to be present for a proper JAR file.

I put 'target' back to 1.1 and the '1.1 conflicts with 1.5' error doesn't abort the compile. It just means the build won't be backward compatible with old JVM's, but I don't much care about that. If I remove or change this compile option I get 'Note: * uses or overrides a depricated API', etc'. I don't yet know how to exec this compile for jdk1.5 without errors. I tried changing '-g:none -O -target 1.1' to '-source 1.5', but the 'uses or overrides' error is still there. The resulting GUI JAR still works OK though. I need to read up & experiment with javac options.

I added a 'rem' to the 'cabarc' line because I don't much care to work with java according to M$ standards, though I realize its prolly not a bad thing to have some knowledge of.

I guess aside from the pathsave stuff & changing directories, the required parts of these processes are to set path & classpath, compile and make the JAR. It shouldn't be too difficult to do with ANT tasks :) From what I've read, it appears Plouf already does it this way.

Maybe next year I'll move to an IDE and ANT or something.

OK, maybe we'll 'chat' again in 7 days :)
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Postby Thema » Tue Dec 26, 2006 11:53 am

rvan1 wrote:I put 'target' back to 1.1 and the '1.1 conflicts with 1.5' error doesn't abort the compile. It just means the build won't be backward compatible with old JVM's, but I don't much care about that. If I remove or change this compile option I get 'Note: * uses or overrides a depricated API', etc'.
If the only message you get is that you are using a deprecated api then I suspect that it's compiling fine. The deprecated API message is telling you that it's being forced to compile 1.1 compatible code and it doesn't like it. However it is doing it just the same.
I always get that message when I compile, but the results are good.

8)
Go on.
Tell me I'm not nice again.
See what it gets you!
*******************************
Lost or confused?
Read the announcement topic in the
Technical Support forum for help tips.
*******************************
Thema
 
Posts: 2881
Joined: Sat Oct 18, 2003 5:34 pm

Postby rvan1 » Wed Dec 27, 2006 8:15 am

Doing the javac and jar tasks with ANT has proven a little more challenging than I thought. I haven't written my own ANT script in 2 years and those were used with Magnolia CMS to synchronize instances with tasks like delete, zip, sshexec, unzip. I've never tried to javac or jar before.

The ANT script can be written as one whole task, but by breaking it up into separate targets that depend on previous targets, you can call out individual tasks if you want. With Eclipse, with the ANT script added to the ANT pane, you can just double click it to execute, using the ANT which comes with Eclipse. Normally you have to download & unpack ANT & set ANT_HOME.

My XP box has ANT, so with 'sbox.xml' in my '/src/' directory, I execute 'ant -f sbox.xml' from command prompt. I found that while the bat file technique will overwrite the classes, with the ANT technique, you have to delete first, so I included a delete task/target. The targets can be called individually (ie: ant -f sbox.xml do_delete). ANT jar will build a manifest if there isn't one and you set it up too.

I noticed my sbox.jar turns out to be 96K rather than 86K, even though I added an optimize attribute. Some of the class files turn out 1K larger for some reason which I need to track down. It also deletes 44 files, but compiles 39, so I need to figure that out too. It works OK when embedded in 'ShoutBox.html', but I get 'ClassNotFoundException: irc.gui.sbox.Interface' when running in application mode.

I was only including the \gui\sbox classes in the JAR, so expanded the jar task to use & include 2 filesets (to get the \tree\ classes in there) but no improvement.

This is what I have so far. Maybe someone will see this and offer some advise on the issues.

sbox.xml (ANT build script)
Code: Select all
<?xml version="1.0"?>
<project name="sbox" default="all">
  <property name="path" value="C:\jdk1.5.0_04\bin"/>
  <property name="basedirec" value="C:\pjirc221\src\irc"/>
  <property name="classpath" value="C:\jdk1.5.0_04;C:\pjirc221\src"/>
  <property name="src" value="C:\pjirc221\src\irc\gui\sbox"/>
 
  <target name="do_delete">
    <delete>
      <fileset dir="${src}" includes="*.class"/>
    </delete>
  </target>
   
  <target name="do_compile" depends="do_delete">
    <javac srcdir="${src}" classpath="${classpath}" debug="on" source="1.5" optimize="true"/>
  </target>
 
  <target name="do_jar" depends="do_compile">   
    <jar destfile="sbox.jar">
      <fileset dir="${basedirec}\gui\sbox" includes="*.class"/>
      <fileset dir="${basedirec}\tree" includes="*.class"/>
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
      </manifest>
    </jar>
  </target>

  <target name="all">
    <antcall target="do_jar"/>
  </target>
</project>
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Postby rvan1 » Wed Dec 27, 2006 6:02 pm

I see that the 'ClassNotFoundException: Interface' IS the same as was posted in another thread. I'll have to check it out later when I'm on my XP box, but am doubtful. The issue is only in application mode. My Control Panel > Java screen doesn't really have a 'cache tab', but there is a view for a list were you can select and clear, but there was nothing in the list.

Clearing MSIE browser cache SHOULDN'T make a difference, but it has been said here that WIndoz makes use of browser components even when not browsing, so, maybe.
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Postby rvan1 » Wed Dec 27, 2006 6:14 pm

I tried this Linux version with Eclipse ANT, and got a few 'unmappable character' errors do to some french puncuation in some comments. I deleted those, get this other error:

[javac] /home/rvan1/pjirc_full/src/irc/gui/sbox/BaseAWTSource.java:43: cannot access irc.gui.GUISource
[javac] bad class file: /home/rvan1/pjirc_full/src/irc/gui/GUISource.class
[javac] class file contains wrong class: src.irc.gui.GUISource
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] public class BaseAWTSource extends Panel implements GUISource,SourceListener,ActionListener,SboxScrollBarListener,FocusListener,StyledListListener,WindowListener,MouseWheelPanelListener,AWTStyleSelectorExListener


Linux ANT build
Code: Select all
<?xml version="1.0"?>
<project name="sbox" default="all">

  <property name="path" value="/usr/java/jdk1.6.0/bin"/>
  <property name="basedirec" value="/home/rvan1/pjirc_full/src/irc" />
  <property name="classpath" value="/usr/java/jdk1.6.0:/home/rvan1/pjirc_full/src" />
  <property name="src" value="/home/rvan1/pjirc_full/src/irc/gui/sbox" />
   
  <target name="do_delete">
    <delete>
      <fileset dir="${src}" includes="*.class"/>
    </delete>
  </target>
      
  <target name="do_compile" depends="do_delete">
    <javac srcdir="${src}" classpath="${classpath}" debug="on" source="1.5" optimize="true"/>
  </target>
   
  <target name="do_jar" depends="do_compile">   
    <jar destfile="sbox2.jar">
      <fileset dir="${basedirec}\gui\sbox" includes="*.class"/>
      <fileset dir="${basedirec}\tree" includes="*.class"/>
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
      </manifest>
    </jar>
  </target>

  <target name="all">
    <antcall target="do_jar"/>
  </target>
 
</project>



Tremendous fun, eh? :)
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Postby Thema » Sat Dec 30, 2006 8:55 am

I'm looking forward to seeing you post the final solution. It will most likely help me when the time comes to go ANT. I'm only sorry that I can't offer any help as you're treading uncharted territory.

8)
Go on.
Tell me I'm not nice again.
See what it gets you!
*******************************
Lost or confused?
Read the announcement topic in the
Technical Support forum for help tips.
*******************************
Thema
 
Posts: 2881
Joined: Sat Oct 18, 2003 5:34 pm

Postby rvan1 » Mon Jan 22, 2007 3:45 pm

Took a second (part-time) job as a java developer, so haven't had time to get back into this. The new webapp I'm working on requires SDK 1.4, so I have it on my box now & should prolly try using that in my build, since that is what is normally used for this.
rvan1
 
Posts: 22
Joined: Wed Dec 13, 2006 5:41 am
Location: Phoenix AZ, USA

Re: error: cannot read: irc\gui\sbox\*.java

Postby anellyex » Thu Jun 11, 2009 12:41 pm

What is the easiest way to view Javascript source code on a website? Most browsers have a "View/Source" option but that only gives you the (X)HTML. I want to inspect and copy javascript features that I like. Any ideas on toolbar features that can do this??
_________________
market samurai ~ marketsamurai ~ marketsamurai.com
anellyex
 
Posts: 1
Joined: Wed Jun 10, 2009 6:25 am


Return to Thema's Mods etc.

Who is online

Users browsing this forum: No registered users and 1 guest