Could not find the main class: Module1. Program will exit
This is my first attempt to write a small code doing Text1.Text = "Yes" and Label1.Caption = "asdfjk" in response to Command1_Click. But I can't even get to see the Form on the screen as a window. In VB, we have to specify where the program should start. In Jabaco, I could not figure out, and the result is the error of not finding the Sub Main. Is there something I have to add to Module1? Thanks.
I will later try to take in three or four VB6 forms with 4 modules, and see how far I manage. I know I will have to change the Open and Close commands for the files, but hopefully not much else.
I will later try to take in three or four VB6 forms with 4 modules, and see how far I manage. I know I will have to change the Open and Close commands for the files, but hopefully not much else.
Hi,
if you create a new SDI Application project in Jabaco, you automatically get a Form1 and a Module1.
Content of Module1 by default:
Content of Form1 for a little test:
I have absolutely no clue what could have gone wrong in your first step.
The missing main indicates that something is wrong with your Module1.
Main is necessary as a starting point for your application.
Please give it another try. It usually takes seconds to hack in such a small sample.
Success!
A1880
if you create a new SDI Application project in Jabaco, you automatically get a Form1 and a Module1.
Content of Module1 by default:
|
|
Source code |
1 2 3 4 5 6 7 8 |
Public Form1 As New Form1 Public Sub main(ByJava args() As String) Dim myArgs() As String myArgs = args Form1.SetDefaultClose() Form1.show() End Sub |
Content of Form1 for a little test:
|
|
Source code |
1 2 3 |
Public Sub Command1_Click() msgbox "hello world!" End Sub |
I have absolutely no clue what could have gone wrong in your first step.
The missing main indicates that something is wrong with your Module1.
Main is necessary as a starting point for your application.
Please give it another try. It usually takes seconds to hack in such a small sample.
Success!
A1880
Hi,
on my Windows PC, I have no references to Java in environment variables like JAVA_HOME or PATH.
So, Jabaco seems to take the Windows registry as pointer to the current Java installation.
On my system:
It might help to download and install a fresh JRE 1.6 on your system.
I don't know if setting JAVA_HOME and PATH would be of any help.
Best regards
A1880
on my Windows PC, I have no references to Java in environment variables like JAVA_HOME or PATH.
So, Jabaco seems to take the Windows registry as pointer to the current Java installation.
On my system:
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment] "CurrentVersion"="1.6" "BrowserJavaVersion"="1.6.0_10" "Java6FamilyVersion"="1.6.0_10" ... [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6] "JavaHome"="C:\\Programme\\Java\\jre6" "RuntimeLib"="C:\\Programme\\Java\\jre6\\bin\\client\\jvm.dll" "MicroVersion"="0" [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_10] "JavaHome"="C:\\Programme\\Java\\jre6" "MicroVersion"="0" "RuntimeLib"="C:\\Programme\\Java\\jre6\\bin\\client\\jvm.dll" |
It might help to download and install a fresh JRE 1.6 on your system.
I don't know if setting JAVA_HOME and PATH would be of any help.
Best regards
A1880
I downloaded Java one more time, but it did not help. I downloaded from www.java.com, and it was quite large.
Now I suspect I should have downloaded from http://java.sun.com/javase/downloads/index.jsp. Which is the right place to download JRE 1.6? Since I know nothing about Java, I couldn't easily distinguish between JRE and the development kit.
Now I suspect I should have downloaded from http://java.sun.com/javase/downloads/index.jsp. Which is the right place to download JRE 1.6? Since I know nothing about Java, I couldn't easily distinguish between JRE and the development kit.
Yes, Java is visible in the control panel (says Java (TM) Control Panel) and I could start it by double clicking. It results in a small window with various setting options: General, Update, Java, Security and Advanced. On the General page, there are About...; Network Settings...; Settings...; and View... for temporary Internet files.
Some more information:
When I try to run a project, on the left side at the bottom on black background I get
*** JDWP-Connection established...
Start ...
Java HotSpot(TM) Client VM 1.6.0_14
--- Console closed in 6 sec.
On the right side at the bottom on black background I get
Listening for transport dt_shmem at address: Jabaco68127531x219
java.lang.NoClassDefFoundError: VBLoader
Caused by: java.lang.ClassNotFoundException: VBLoader
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
I can compile it to an *.exe anyway.
Does this say something?
When I try to run a project, on the left side at the bottom on black background I get
*** JDWP-Connection established...
Start ...
Java HotSpot(TM) Client VM 1.6.0_14
--- Console closed in 6 sec.
On the right side at the bottom on black background I get
Listening for transport dt_shmem at address: Jabaco68127531x219
java.lang.NoClassDefFoundError: VBLoader
Caused by: java.lang.ClassNotFoundException: VBLoader
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
I can compile it to an *.exe anyway.
Does this say something?
Similar threads
-
Bugreports and known bugs »-
[VERSION 1.4.0] Bug Report: Arithmetic operations
(Mar 24th 2009, 2:20pm)
-
General topics, questions and discussions »-
My Jabaco has stoppped making correct jar-files and executables
(May 9th 2009, 4:59am)
-
General topics, questions and discussions »-
compile jabaco source file to class file
(Mar 27th 2009, 9:44am)
-
History & News »-
RELEASE: Jabaco 1.4.0 BETA - 2008-11-18
(Nov 21st 2008, 8:52pm)
