Java works, but not for local files

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

21. May 2010, 04:32:24

GobanToba

Posts: 31

Java works, but not for local files

I am using Opera 10.53 and have Java 1.6 u20. It works great. I can run all the apps here for example,
http://java.sun.com/applets/jdk/1.4/index.html


I can't run Java apps locally though. I have folder with an index.html and the class files. I'm using Win7 and the java icon appears in the tray so java loads. The local Java app loads fine in Chrome and IE from the folder.

I went through all the Java threads and opera:config is good the plugins are good (none in C:program files/opera....) Again, Java applets work fine from the web. Seems like maybe a security issue or something? I thought maybe a Win7 issue, but they work in Chrome and IE locally so...

The html file loads and the where the Java app should be it says error and you can get more details which are below:


Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02 Java HotSpot(TM) Client VM
User home directory = C:\Users\bob
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------


load: class BubbleSort.class not found.
java.lang.ClassNotFoundException: BubbleSort.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: \localhost\BubbleSort\class.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: BubbleSort.class




Here is what the HTML file looks like. The class file is just sitting in the same folder:
<HTML>
<HEAD>
<TITLE>Stack</TITLE>
</HEAD>

<BODY>

   <TABLE BORDER UNITS=PIXELS COLSPEC="L330 L250" CELLPADDING=7>
   <CAPTION><STRONG>Lafore's Stack</STRONG></CAPTION>
      <TH>Stack
      <TH>Operation
      <TR>
      <TD>
         <APPLET
            CODE=Stack.class
            WIDTH=440
            HEIGHT=320>
         </APPLET>
      <TD>
            <BR>
            <FONT SIZE=2>
<STRONG>New</STRONG> creates new stack
            </FONT><P>
            <FONT SIZE=2>
<STRONG>Push</STRONG> inserts item with value N at top
of stack.
            </FONT><P>
            <FONT SIZE=2>
<STRONG>Pop</STRONG> removes item from top of stack,
returns value.
            </FONT><P>
            <FONT SIZE=2>
<STRONG>Peek</STRONG> returns value of item at top
of stack.
            </FONT><P>
            <FONT SIZE=2>
(Type N into "Enter number" box.)
            </FONT><P>
   </TABLE>
</BODY>
</HTML>


21. May 2010, 14:00:07

Al-Khwarizmi

Posts: 87

Confirmed (10.53, Win XP, Java 6 update 20)

21. May 2010, 16:34:41

GobanToba

Posts: 31

Thanks guys for posting. Just wanted to make sure there wasn't check box I missed or something. ;-)

Have an idea for a work around. I'll post if it works.

21. May 2010, 20:12:01

GobanToba

Posts: 31

Found a workaround. Not a good one, but it works if you need it to.

Basically I just started Opera Unite webserver and pointed to the folder where I have my local java apps. Then I just access them through the opera unite url and they work fine.

A little bit of a pain, but hey, it works.

2. June 2010, 02:43:56

shimam

Posts: 3

I found another workaround.

I set a sharingname for my folder where applets are, then I can run the applets with URL of sharing name.
Perhaps, URL including "localhost" is not good.

I don't know whether it's a bug or spec.

24. June 2010, 07:13:18

mikemvpi

Posts: 8

Still have it in Opera 10.54 build 3423
JRE: Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
OS: WinXP SP2

load: class applet.TestApplet not found.  
java.lang.ClassNotFoundException: applet.TestApplet 
...
Caused by: java.io.FileNotFoundException: \localhost\c:\work\applet\TestApplet.class
....


HTML:
<applet code="applet.TestApplet" archive="test.jar" codebase="." width="710" height="540"/>


totally same without specifying codebase attribute

25. June 2010, 01:08:44

choope

pine tree

Posts: 407

The latest build Lex1 referred to is the 10.60 beta. Go the Desktop Team Blog to fetch the latest snapshot.
Core fixes: Thursday, 17. June 2010, 09:05:00
CORE-27614 (New Java plug-in can't find applet on local pages because it doesn't understand "")

This was in Builds 3426 for Windows, Mac-8387, *nix-6372. There have been four newer builds since this was released. Also be aware of this notice for alpha, beta software: WARNING: This is a development snapshot of Opera. It is released for testing purposes, and there may be serious bugs and unfinished features.
Firefox 23.0, Opera 10.11-4791; Platform: SunOS (OpenIndiana); System: i86pc  Opera Desktop Team Security @ Opera Sitepatching blog
Linux in VirtualBox | Opera 12.15-1748

Forums » Opera for Windows/Mac/Linux » Opera browser